This document describes the v2 Search API of Fess. For the common response envelope, error model, and CSRF, see API Overview.
The base URL is http://<Server Name>/api/v2/ (local environment example: http://localhost:8080/api/v2).
Document Search
Request
| HTTP Method | GET |
| Endpoint | /api/v2/search |
Searches for documents matching the query and returns the results in a common envelope. All field names in the payload use snake_case.
Request Parameters
Table: Request Parameters
Response
On success (200), the following fields are returned directly under response in the common envelope.
Each field is described below.
Table: Response Fields
Error Response
For details on the error model, see API Overview. The HTTP statuses returned by this endpoint are as follows.
| Status Code | Description |
| 400 Bad Request | The request is invalid. |
| 405 Method Not Allowed | The HTTP method is not allowed. |
| 500 Internal Server Error | An internal server error occurred. |
Table: Error Response
Fetching All Documents (Scroll Search / NDJSON)
Request
| HTTP Method | GET |
| Endpoint | /api/v2/documents/all |
Streams all documents matching the query as NDJSON (application/x-ndjson). Each line is a {"data":{...}} object containing fields permitted by QueryFieldConfig#isApiResponseField.
If a failure occurs mid-stream, the final line is flushed as follows:
Therefore, clients must check the first key of the last line to distinguish successful completion (data) from a server error (error).
The query is built using the same parameter set as GET /search (q, sort, num, lang, ex_q, sdh, fields.*, as.*, track_total_hits, facet.*, geo.*). If scroll search is disabled with api.search.scroll=false, the endpoint returns invalid_request (400).
Request Parameters
The parameters explicitly specified in the spec are as follows.
Table: Request Parameters
Response
On success (200), the Content-Type is application/x-ndjson, with one document per line as shown below.
Error Response
For details on the error model, see API Overview. The HTTP statuses returned by this endpoint are as follows.
Table: Error Response