Search API: Autocomplete Method

Follow

Description

  • Executes an autocomplete query. Returns a deferred object.

Parameters:

  • query
    • The search term.  Uses simple Lucerne syntax.
  • languageCode
    • The language you want to return results from.  This is the current language of the site by default.  LanguageCode is interpreted from search results using the language meta tag, or from the agility_attributes meta tag that is generated by default in all Agility pages.
    • This must be an exact match.
  • category
    • If your site has the "category" selector setup in the search settings, you can limit results to a particular category string.  
    • This must be an exact match.
  • domain
    • If you have specified multiple domains for your search index, you can filter by the domain here.
    • This must be an exact match.
  • top
    • The number of results to return.
  • fuzzy
    • True/false - indicates where you wish to return exact matches or "fuzzy" matches.

Callbacks

  • success (response)
    • The autocomplete completed successfully.
    • The response parameter is an Array of strings with the autocompleted results.
  • error(message)
    • Indicates that an error occurred, with the relative error message as a parameter.
  • always
    • Indicates that the HTTP request to the search server has completed.

Example

 
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.