Smart Answers API


The SearchStax Site Search solution’s Smart Answers API offers AI-powered question-answering capabilities, integrated with Apache Solr for document retrieval. This service generates contextual answers to user queries by leveraging stored documents and AI processing.

GET <Smart Answers Endpoint>?q=<question> 

The Smart Answers Endpoint is located on the Site Search > App Settings > All APIs > Search & Indexing screen.

This method uses Token authentication.

The method returns a streaming response with media type text/event-stream.

  • If the query is a question, the stream returns I_AM_A_QUESTION followed by the answer.
  • If the query is not a question, the stream returns I_AM_NOT_A_QUESTION

Example

This is a cURL example as sent from a Bash or PowerPoint command line:

curl -X GET \
  "https://search-ai-us.searchstax.com/api/v1/1234/answer/?q=What%20is%20solr&language=en" \
  -H "authorization: Token <Read_Only_Token>" \
  -H "Accept: text/event-stream"

Request Parameters

ParameterDescription
q
required
string
The user’s question
ignore_cache
optional
boolean
True or False, used to bypass cached answers.
additional parameters
optional
Any additional parameters that are normally used by the Search API, like start, spellcheck, language, model, etc.

Questions?

Do not hesitate to contact the SearchStax Support Desk.