- Manage API keys
- HTTP request header
- REST verb
- REST API endpoint
- Request parameter
- Obtaining suggested query completions
Use the Suggestions API to obtain suggested query completions.
Manage API keys
The Suggestions API uses Search API keys.
HTTP request header
An HTTP request for the Suggest API must contain the
X-API-Key header, a custom HTTP header to contain the Search API key.
The REST verb for searches is
REST API endpoint
Specify the query to use for obtaining suggested query completions.
This is the available request parameter:
|Parameter||Description and example||Type||Default|
Query term to search for
Obtaining suggested query completions
Here we describe how to obtain suggested query completions. We also give some information about handling responses.
Submit a request
In your app, construct and submit HTTP requests to the Search API. These are example requests and responses:
In the Site Search app, you can copy a sample
curl command that submits a request.
In the Site Search menu, click Search APIs.
Under "Suggest query completiongs", hover over the sample
curlcommand, and then click Copy.
Paste the command into a text editor.
Include a Search API key and modify the search-request parameters as desired.
curlcommand at a command prompt.
This is an example of a request for suggested query completions for
curl -H 'X-API-Key: 7556b805-662d-44c8-b467-d8cb0fa476e56765f6e6-dd60-4fdc-9c53-d8c03edb3a2e' 'https://fusion-search.lucidworks.cloud/search-3/api/v1/suggest?topics=la_presse&q=justi'
[ "justice", "justin", "justify", "justine", "justifier", "justified", "justification", "justices", "justifiant", "justifie" ]