Home > Azure > Azure API > AZURE COGNITIVE SEARCH: Autocomplete the search keyword through POSTMAN

AZURE COGNITIVE SEARCH: Autocomplete the search keyword through POSTMAN

This post was most recently updated on October 19th, 2022

AUTOCOMPLETE
The Autocomplete API finishes a partially typed query input using existing terms in the search index for use in a secondary query

  • Method: POST
  • URL: https://[name of the search service].windows.net/indexes/[name of the index]/ autocomplete/search?api-version=[api version]
  • Authorization:
    Type – API Key
    Vale- [Value of the Primary Key]
    Add to- Header
  • Headers:
    Content-Type- “application/json”
    API-Key – [value of the api key]
  • Body:
    {
      “autocompleteMode”:”twoTerms”,
      “search”: “[search keyword]”,
      “searchFields”:”[field in which you want to apply the search criteria]”
    }

N.B.:
The “autocompleteMode” is set to oneTerm by default. “oneTerm” returns a single term. “twoTerms” matches on two-term phrases in the index. “oneTermWithContext ” completes the last term in a query with two or more terms, where the last two terms are a phrase that exists in the index.

 

Response: 200 OK

This Article is TAGGED in , , . BOOKMARK THE permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">