This document describes the v2 Search History API of Fess. For the common response envelope and error model, see API Overview.
The base URL is http://<Server Name>/api/v2/ (local environment example: http://localhost:8080/api/v2).
Note
Search history is available while both search.history.enabled (default: true) and the search log are enabled. features.search_history of /api/v2/ui/config reports the state.
Getting Recent Searches
Request
| HTTP Method | GET |
| Endpoint | /api/v2/search-history |
Returns the recent searches that the logged-in user made with /api/v2/search on the current virtual host, newest first. A client can run one of them again with the returned conditions.
Only first-page searches are listed. Searches with the same conditions are merged into the newest one, and searches without a query are left out.
At most
search.history.size(default:10) searches are returned.Search logs are written by a job that runs every minute, so a search can take up to about a minute to appear.
The history is keyed on the logged-in user of the session. Anonymous callers receive
auth_required(401); an access token does not stand in for a login.When search history is disabled, the endpoint responds with
invalid_request(400).
There are no request parameters.
Response
On success (200), the following fields are returned directly under response of the common envelope.
Table: Response Fields
Error Response
Table: Error Response
In the Bundled Theme
In the bundled bootstrap theme, a logged-in user sees the recent searches in the suggest dropdown when they click the empty search box or press the down arrow key in it. Choosing an entry runs the same search again, including conditions such as labels. Search logs recorded before Fess 15.9 carry no conditions and are not listed.