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.
The q parameter accepts the same search syntax available on the standard search screen – AND/OR/NOT search, field-specified search, wildcard search, fuzzy search, and more. For details on the search syntax, see Fess User Guide.
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
Note
When a plugin sends the search elsewhere instead of running it (for example a DuckDuckGo-style bang such as !g), the success response holds only q and redirect_url. The client is expected to navigate to redirect_url.
Error Response
For details on the error model, see API Overview. The HTTP statuses returned by this endpoint are as follows.
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. Unlike GET /search, the search score score is not included.
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.*). Scroll search is disabled by default (api.search.scroll=false). While it is disabled, the endpoint returns invalid_request (400). To enable it, set api.search.scroll=true in fess_config.properties (see Bulk Retrieval of Search Results).
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