JSON API
Fess supports JSON API response.
Request
The request URL for JSON API is http://localhost:8080/json?q=SearchWords. Available request parameters are as below.
| q | Search query. |
| start | Start position(default 0) |
| num | The number of documents in search result page to display them(default 20). |
| fields.label | Label to filter documents with the label. |
| callback | JSONP callback name. (default response is JSON) |
| facet.field | Facet Field query. ex. facet.field=label |
| facet.query | Facet query. ex. facet.query=timestamp:[now/d-1d TO *] |
| facet.size | The number of facet results. |
Table: Request parameters
Please note that the HTTP Accept-Language header should be set, depending on the presumed languages of the results the output of curl 'http://192.168.0.1:8080/json/?q=maier' -H 'Accept-Language: de-DE,de;' can differ substantially from curl 'http://192.168.0.1:8080/json/?q=maier'
Response
Response example is as below.
Each element is as follows.
| response | The root element. |
| version | Format version. |
| status | The status of the response. the status value is 0: normal, 1: search error, 2 or 3: request parameter error, 9: in service, 1: API type of error is. |
| query | Search query. |
| exec_time | Response time(seconds). |
| page_size | The number of documents in search result. |
| page_number | Page number. |
| record_count | The number of hits for the search query. |
| page_count | Total page size. |
| result | Parent element of the search results. |
| site | Site name. |
| content_description | Description of the document. |
| host | Host name. |
| last_modified | Last modified date. |
| cache | Content cache. |
| score | Search score of the document. |
| digest | Digest content of the document. |
| created | Indexed date. |
| url | URL of the document. |
| doc_id | ID of the document. |
| mimetype | MIME type. |
| title | Title of the document. |
| content_title | Title of the document for search view. |
| content_length | Size of the document. |
| url_link | URL as the search results. |
Table: Response information