From e1d4febfc458c9d8665ff7937d1621948b81ad9c Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 20 Feb 2026 07:06:22 +0100 Subject: [PATCH] Autocomplete suggestion endpoint doc --- search-endpoint.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/search-endpoint.md b/search-endpoint.md index 7916c6eb..b5ec25c0 100644 --- a/search-endpoint.md +++ b/search-endpoint.md @@ -823,6 +823,46 @@ The returned JSON response will be like: } ``` +## Autocomplete suggestions +**/api/discover/suggest** + +This endpoint returns a list of terms from a the Solr search core suggest handler. This is configured in solrconfig.xml and, if using with existing metatavalues (as opposed to a flat file), discovery.cfg. + +The following parameters are required: + +* `dict`: The name of the dictionary / suggest component e.g. "subject" or "countries_file" +* `q`: A string query (at least 3 characters) to match against autocomplete suggestions + +The response is JSON representation as returned by Solr, there are no addressable DSpace objects in the response so no further modelling is used by the REST API. + +This is currently used by some vocabularies in submission forms (see traditionalpagetwo subject field for an example) and can be used elsewhere in the frontend or integrated systems. + +Example response + +``` +{ + "responseHeader": { + "status": 0, + "QTime": 11 + }, + "suggest": { + "subject": { + "test": { + "numFound": 1, + "suggestions": [ + { + "term": "Test/b> Subject", + "weight": 1, + "payload": "" + } + ] + } + } + } +} +``` + + ## Special configurations ### workspace