swagger: "2.0"
schemes:
  - https
host: azure.local
info:
  description: Client that can be used to query an index and upload, merge, or delete documents.
  title: SearchIndexClient
  version: 2019-05-06
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-ms-code-generation-settings:
    syncMethods: None
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/search/data-plane/Microsoft.Azure.Search.Data/track1/stable/2019-05-06/searchindex.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: search-searchindex
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
parameters:
  ApiVersionParameter:
    description: Client Api Version.
    in: query
    name: api-version
    required: true
    type: string
  ClientRequestIdParameter:
    description: The tracking ID sent with the request to help with debugging.
    format: uuid
    in: header
    name: client-request-id
    required: false
    type: string
    x-ms-client-request-id: true
    x-ms-parameter-grouping:
      name: search-request-options
    x-ms-parameter-location: method
  IndexNameParameter:
    description: The name of the index.
    in: path
    name: indexName
    required: true
    type: string
    x-ms-parameter-location: client
    x-ms-skip-url-encoding: false
  SearchDnsSuffixParameter:
    default: search.windows.net
    description: The DNS suffix of the search service. The default is search.windows.net.
    in: path
    name: searchDnsSuffix
    required: true
    type: string
    x-ms-parameter-location: client
    x-ms-skip-url-encoding: true
  SearchServiceNameParameter:
    description: The name of the search service.
    in: path
    name: searchServiceName
    required: true
    type: string
    x-ms-parameter-location: client
    x-ms-skip-url-encoding: true
paths:
  /docs:
    get:
      description: Searches for documents in the index.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/Search-Documents
      operationId: Documents_SearchGet
      parameters:
        - description: A full-text search query expression; Use "*" or omit this parameter to match all documents.
          in: query
          name: search
          type: string
          x-ms-client-name: SearchText
        - description: A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation.
          in: query
          name: $count
          type: boolean
          x-ms-client-name: IncludeTotalResultCount
          x-ms-parameter-grouping:
            name: SearchParameters
          x-nullable: false
        - collectionFormat: multi
          description: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs.
          in: query
          items:
            type: string
          name: facet
          type: array
          x-ms-client-name: Facets
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: The OData $filter expression to apply to the search query.
          in: query
          name: $filter
          type: string
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: The list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting.
          in: query
          items:
            type: string
          name: highlight
          type: array
          x-ms-client-name: HighlightFields
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is &lt;/em&gt;.
          in: query
          name: highlightPostTag
          type: string
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is &lt;em&gt;.
          in: query
          name: highlightPreTag
          type: string
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: A number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100.
          format: double
          in: query
          name: minimumCoverage
          type: number
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, and desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no OrderBy is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses.
          in: query
          items:
            type: string
          name: $orderby
          type: array
          x-ms-client-name: OrderBy
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax.
          enum:
            - simple
            - full
          in: query
          name: queryType
          type: string
          x-ms-enum:
            modelAsString: false
            name: QueryType
          x-ms-parameter-grouping:
            name: SearchParameters
          x-nullable: false
        - collectionFormat: multi
          description: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes).
          in: query
          items:
            type: string
          name: scoringParameter
          type: array
          x-ms-client-name: ScoringParameters
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results.
          in: query
          name: scoringProfile
          type: string
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter.
          in: query
          items:
            type: string
          name: searchFields
          type: array
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match.
          enum:
            - any
            - all
          in: query
          name: searchMode
          type: string
          x-ms-enum:
            modelAsString: false
            name: SearchMode
          x-ms-parameter-grouping:
            name: SearchParameters
          x-nullable: false
        - description: The list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included.
          in: query
          items:
            type: string
          name: $select
          type: array
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use $skip due to this limitation, consider using $orderby on a totally-ordered key and $filter with a range query instead.
          format: int32
          in: query
          name: $skip
          type: integer
          x-ms-parameter-grouping:
            name: SearchParameters
        - description: The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results.
          format: int32
          in: query
          name: $top
          type: integer
          x-ms-parameter-grouping:
            name: SearchParameters
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ClientRequestIdParameter"
      responses:
        "200":
          description: Response containing documents that match the search criteria.
          schema:
            $ref: "#/definitions/DocumentSearchResult"
      tags:
        - Documents
      x-ms-examples:
        SearchIndexSearchDocumentsGet:
          parameters:
            $count: true
            $filter: rating gt 10
            $orderby:
              - search.score() desc
              - rating desc
            $select:
              - docId
              - title
              - description
            $skip: 100
            $top: 10
            api-version: 2019-05-06
            facet:
              - category,count:10,sort:count
            highlight:
              - title
            highlightPostTag: </em>
            highlightPreTag: <em>
            indexName: myindex
            minimumCoverage: 80
            queryType: simple
            scoringParameters:
              - currentLocation--122.123,44.77233
            scoringProfile: sp
            search: nice hotels
            searchDnsSuffix: search.windows.net
            searchFields:
              - title
              - description
            searchMode: any
            searchServiceName: myservice
          responses:
            "200":
              body:
                "@odata.count": 25
                "@search.coverage": 80
                "@search.facets":
                  category:
                    - count: 1
                      value: Economy
                    - count: 1
                      value: Luxury
                value:
                  - "@search.highlights":
                      title:
                        - <em>Nice</em> <em>Hotel</em>
                    "@search.score": 1.5
                    description: Cheapest hotel in town
                    docId: "1"
                    title: Nice Hotel
                  - "@search.highlights":
                      title:
                        - Fancy <em>Hotel</em>
                    "@search.score": 0.7
                    description: Best hotel in town
                    docId: "2"
                    title: Fancy Hotel
      x-ms-request-id: request-id
  "/docs('{key}')":
    get:
      description: Retrieves a document from the index.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/lookup-document
      operationId: Documents_Get
      parameters:
        - description: The key of the document to retrieve.
          in: path
          name: key
          required: true
          type: string
        - description: List of field names to retrieve for the document; Any field not retrieved will be missing from the returned document.
          in: query
          items:
            type: string
          name: $select
          type: array
          x-ms-client-name: SelectedFields
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ClientRequestIdParameter"
      responses:
        "200":
          description: Response containing the requested document.
          schema:
            type: object
      tags:
        - Documents
      x-ms-examples:
        SearchIndexGetDocument:
          parameters:
            $select:
              - docId
              - title
              - description
            api-version: 2019-05-06
            indexName: myindex
            key: "1"
            searchDnsSuffix: search.windows.net
            searchServiceName: myservice
          responses:
            "200":
              body:
                description: Cheapest hotel in town
                docId: "1"
                title: Nice Hotel
  /docs/$count:
    get:
      description: Queries the number of documents in the index.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/Count-Documents
      operationId: Documents_Count
      parameters:
        - $ref: "#/parameters/ClientRequestIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: ""
          schema:
            format: int64
            type: integer
      tags:
        - Documents
      x-ms-examples:
        SearchIndexCountDocuments:
          parameters:
            api-version: 2017-11-11-Preview
            indexName: myindex
            searchDnsSuffix: search.windows.net
            searchServiceName: myservice
          responses:
            "200":
              body: 427
      x-ms-request-id: request-id
  /docs/search.autocomplete:
    get:
      description: Autocompletes incomplete query terms based on input text and matching terms in the index.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/autocomplete
      operationId: Documents_AutocompleteGet
      parameters:
        - $ref: "#/parameters/ClientRequestIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
        - description: The incomplete term which should be auto-completed.
          in: query
          name: search
          required: true
          type: string
          x-ms-client-name: SearchText
        - description: The name of the suggester as specified in the suggesters collection that's part of the index definition.
          in: query
          name: suggesterName
          required: true
          type: string
        - description: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms.
          enum:
            - oneTerm
            - twoTerms
            - oneTermWithContext
          in: query
          name: autocompleteMode
          type: string
          x-ms-enum:
            modelAsString: false
            name: AutocompleteMode
          x-ms-parameter-grouping:
            name: AutocompleteParameters
          x-nullable: false
        - description: An OData expression that filters the documents used to produce completed terms for the Autocomplete result.
          in: query
          name: $filter
          type: string
          x-ms-parameter-grouping:
            name: AutocompleteParameters
        - description: A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will find terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources.
          in: query
          name: fuzzy
          type: boolean
          x-ms-client-name: UseFuzzyMatching
          x-ms-parameter-grouping:
            name: AutocompleteParameters
        - description: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled.
          in: query
          name: highlightPostTag
          type: string
          x-ms-parameter-grouping:
            name: AutocompleteParameters
        - description: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled.
          in: query
          name: highlightPreTag
          type: string
          x-ms-parameter-grouping:
            name: AutocompleteParameters
        - description: A number between 0 and 100 indicating the percentage of the index that must be covered by an autocomplete query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80.
          format: double
          in: query
          name: minimumCoverage
          type: number
          x-ms-parameter-grouping:
            name: AutocompleteParameters
        - description: The list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.
          in: query
          items:
            type: string
          name: searchFields
          type: array
          x-ms-parameter-grouping:
            name: AutocompleteParameters
        - description: The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5.
          format: int32
          in: query
          name: $top
          type: integer
          x-ms-parameter-grouping:
            name: AutocompleteParameters
      responses:
        "200":
          description: ""
          schema:
            $ref: "#/definitions/AutocompleteResult"
            description: The result of Autocomplete query.
      tags:
        - Documents
      x-ms-examples:
        SearchIndexAutocompleteDocumentsGet:
          parameters:
            api-version: 2019-05-06
            autocompleteMode: oneTerm
            filter: search.in(docId,'101,102,105')
            fuzzy: false
            highlightPostTag: </em>
            highlightPreTag: <em>
            indexName: myindex
            minimumCoverage: 80
            search: washington medic
            searchDnsSuffix: search.windows.net
            searchFields:
              - title
              - description
            searchServiceName: myservice
            suggesterName: sg
            top: 10
          responses:
            "200":
              body:
                - queryPlusText: washington medicaid
                  text: medicaid
                - queryPlusText: washington medicare
                  text: medicare
                - queryPlusText: washington medicine
                  text: medicine
      x-ms-request-id: request-id
  /docs/search.index:
    post:
      description: Sends a batch of document write actions to the index.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents
      operationId: Documents_Index
      parameters:
        - description: The batch of index actions.
          in: body
          name: batch
          required: true
          schema:
            $ref: "#/definitions/IndexBatch"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ClientRequestIdParameter"
      responses:
        "200":
          description: Response containing the status of operations for all actions in the batch.
          schema:
            $ref: "#/definitions/DocumentIndexResult"
        "207":
          description: Response containing the status of operations for all actions in the batch.
          schema:
            $ref: "#/definitions/DocumentIndexResult"
      tags:
        - Documents
      x-ms-examples:
        SearchIndexIndexDocuments:
          parameters:
            api-version: 2019-05-06
            batch:
              value:
                - "@search.action": upload
                  description: Best hotel in town
                  docId: "1"
                  title: Fancy Stay
                - "@search.action": merge
                  docId: "2"
                  title: Roach Motel
                - "@search.action": mergeOrUpload
                  docId: "3"
                  title: Econo Motel
                - "@search.action": delete
                  docId: "4"
            indexName: myindex
            searchDnsSuffix: search.windows.net
            searchServiceName: myservice
          responses:
            "200":
              body:
                value:
                  - errorMessage: null
                    key: "1"
                    status: true
                    statusCode: 201
                  - errorMessage: null
                    key: "2"
                    status: true
                    statusCode: 200
                  - errorMessage: null
                    key: "3"
                    status: true
                    statusCode: 200
                  - errorMessage: null
                    key: "4"
                    status: true
                    statusCode: 200
            "207":
              body:
                value:
                  - errorMessage: null
                    key: "1"
                    status: true
                    statusCode: 200
                  - errorMessage: Document not found.
                    key: "2"
                    status: false
                    statusCode: 404
                  - errorMessage: null
                    key: "3"
                    status: true
                    statusCode: 200
                  - errorMessage: null
                    key: "4"
                    status: true
                    statusCode: 200
      x-ms-request-id: request-id
  /docs/search.post.autocomplete:
    post:
      description: Autocompletes incomplete query terms based on input text and matching terms in the index.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/autocomplete
      operationId: Documents_AutocompletePost
      parameters:
        - $ref: "#/parameters/ClientRequestIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
        - description: The definition of the Autocomplete request.
          in: body
          name: autocompleteRequest
          required: true
          schema:
            $ref: "#/definitions/AutocompleteRequest"
      responses:
        "200":
          description: ""
          schema:
            $ref: "#/definitions/AutocompleteResult"
            description: The result of Autocomplete query.
      tags:
        - Documents
      x-ms-examples:
        SearchIndexAutocompleteDocumentsPost:
          parameters:
            api-version: 2017-11-11-Preview
            autocompleteRequest:
              autocompleteMode: oneTerm
              filter: search.in(docId,'101,102,105')
              highlightPostTag: </em>
              highlightPreTag: <em>
              minimumCoverage: 80
              search: washington medic
              searchFields: title,description
              suggesterName: sg
              top: 10
            indexName: myindex
            searchDnsSuffix: search.windows.net
            searchServiceName: myservice
          responses:
            "200":
              body:
                - queryPlusText: washington medicaid
                  text: medicaid
                - queryPlusText: washington medicare
                  text: medicare
                - queryPlusText: washington medicine
                  text: medicine
      x-ms-request-id: request-id
  /docs/search.post.search:
    post:
      description: Searches for documents in the index.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/Search-Documents
      operationId: Documents_SearchPost
      parameters:
        - description: The definition of the Search request.
          in: body
          name: searchRequest
          required: true
          schema:
            $ref: "#/definitions/SearchRequest"
            description: The Search request.
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ClientRequestIdParameter"
      responses:
        "200":
          description: Response containing documents that match the search criteria.
          schema:
            $ref: "#/definitions/DocumentSearchResult"
      tags:
        - Documents
      x-ms-examples:
        SearchIndexSearchDocumentsPost:
          parameters:
            api-version: 2019-05-06
            indexName: myindex
            searchDnsSuffix: search.windows.net
            searchRequest:
              count: true
              facets:
                - category,count:10,sort:count
              filter: rating gt 4.0
              highlight: title
              highlightPostTag: </em>
              highlightPreTag: <em>
              minimumCoverage: null
              orderby: search.score() desc,rating desc
              queryType: simple
              scoringParameters:
                - currentLocation--122.123,44.77233
              scoringProfile: sp
              search: nice hotels
              searchFields: title,description
              searchMode: any
              select: docId,title,description
              skip: 0
              top: 10
            searchServiceName: myservice
          responses:
            "200":
              body:
                "@odata.count": 25
                "@odata.nextLink": https://myservice.search.windows.net/indexes('myindex')/docs/search.post.search?api-version=2019-05-06
                "@search.facets":
                  category:
                    - count: 1
                      value: Economy
                    - count: 1
                      value: Luxury
                "@search.nextPageParameters":
                  count: true
                  facets:
                    - category,count:10,sort:count
                  filter: rating gt 4.0
                  highlight: title
                  highlightPostTag: </em>
                  highlightPreTag: <em>
                  minimumCoverage: null
                  orderby: search.score() desc,rating desc
                  queryType: simple
                  scoringParameters:
                    - currentLocation--122.123,44.77233
                  scoringProfile: sp
                  search: nice hotels
                  searchFields: title,description
                  searchMode: any
                  select: docId,title,description
                  skip: 2
                  top: 8
                value:
                  - "@search.highlights":
                      title:
                        - <em>Nice</em> <em>Hotel</em>
                    "@search.score": 1.5
                    description: Cheapest hotel in town
                    docId: "1"
                    title: Nice Hotel
                  - "@search.highlights":
                      title:
                        - Fancy <em>Hotel</em>
                    "@search.score": 0.7
                    description: Best hotel in town
                    docId: "2"
                    title: Fancy Hotel
      x-ms-request-id: request-id
  /docs/search.post.suggest:
    post:
      description: Suggests documents in the index that match the given partial query text.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/suggestions
      operationId: Documents_SuggestPost
      parameters:
        - description: The Suggest request.
          in: body
          name: suggestRequest
          required: true
          schema:
            $ref: "#/definitions/SuggestRequest"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ClientRequestIdParameter"
      responses:
        "200":
          description: Response containing suggested documents that match the partial input.
          schema:
            $ref: "#/definitions/DocumentSuggestResult"
      tags:
        - Documents
      x-ms-examples:
        SearchIndexSuggestDocumentsPost:
          parameters:
            api-version: 2019-05-06
            indexName: myindex
            searchDnsSuffix: search.windows.net
            searchServiceName: myservice
            suggestRequest:
              filter: rating gt 4.0
              highlightPostTag: </em>
              highlightPreTag: <em>
              minimumCoverage: 80
              orderby: rating desc
              search: hote
              searchFields: title
              select: docId,title,description
              top: 10
          responses:
            "200":
              body:
                value:
                  - "@search.text": Nice <em>Hotel</em>
                    description: Cheapest hotel in town
                    docId: "1"
                    title: Nice Hotel
                  - "@search.text": Fancy <em>Hotel</em>
                    description: Best hotel in town
                    docId: "2"
                    title: Fancy Hotel
      x-ms-request-id: request-id
  /docs/search.suggest:
    get:
      description: Suggests documents in the index that match the given partial query text.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/searchservice/suggestions
      operationId: Documents_SuggestGet
      parameters:
        - description: The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters.
          in: query
          name: search
          required: true
          type: string
          x-ms-client-name: SearchText
        - description: The name of the suggester as specified in the suggesters collection that's part of the index definition.
          in: query
          name: suggesterName
          required: true
          type: string
        - description: An OData expression that filters the documents considered for suggestions.
          in: query
          name: $filter
          type: string
          x-ms-parameter-grouping:
            name: SuggestParameters
        - description: A value indicating whether to use fuzzy matching for the suggestions query. Default is false. When set to true, the query will find terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy suggestions queries are slower and consume more resources.
          in: query
          name: fuzzy
          type: boolean
          x-ms-client-name: UseFuzzyMatching
          x-ms-parameter-grouping:
            name: SuggestParameters
          x-nullable: false
        - description: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled.
          in: query
          name: highlightPostTag
          type: string
          x-ms-parameter-grouping:
            name: SuggestParameters
        - description: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled.
          in: query
          name: highlightPreTag
          type: string
          x-ms-parameter-grouping:
            name: SuggestParameters
        - description: A number between 0 and 100 indicating the percentage of the index that must be covered by a suggestions query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80.
          format: double
          in: query
          name: minimumCoverage
          type: number
          x-ms-parameter-grouping:
            name: SuggestParameters
        - description: The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses.
          in: query
          items:
            type: string
          name: $orderby
          type: array
          x-ms-client-name: OrderBy
          x-ms-parameter-grouping:
            name: SuggestParameters
        - description: The list of field names to search for the specified search text. Target fields must be included in the specified suggester.
          in: query
          items:
            type: string
          name: searchFields
          type: array
          x-ms-parameter-grouping:
            name: SuggestParameters
        - description: The list of fields to retrieve. If unspecified, only the key field will be included in the results.
          in: query
          items:
            type: string
          name: $select
          type: array
          x-ms-parameter-grouping:
            name: SuggestParameters
        - description: The number of suggestions to retrieve. The value must be a number between 1 and 100. The default is 5.
          format: int32
          in: query
          name: $top
          type: integer
          x-ms-parameter-grouping:
            name: SuggestParameters
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ClientRequestIdParameter"
      responses:
        "200":
          description: Response containing suggested documents that match the partial input.
          schema:
            $ref: "#/definitions/DocumentSuggestResult"
      tags:
        - Documents
      x-ms-examples:
        SearchIndexSuggestDocumentsGet:
          parameters:
            $filter: rating gt 10
            $orderby:
              - search.score() desc
              - rating desc
            $select:
              - docId
              - title
              - description
            $top: 10
            api-version: 2019-05-06
            fuzzy: false
            highlightPostTag: </em>
            highlightPreTag: <em>
            indexName: myindex
            minimumCoverage: 80
            search: hote
            searchDnsSuffix: search.windows.net
            searchFields:
              - title
            searchServiceName: myservice
            suggesterName: sg
          responses:
            "200":
              body:
                value:
                  - "@search.text": Nice <em>Hotel</em>
                    description: Cheapest hotel in town
                    docId: "1"
                    title: Nice Hotel
                  - "@search.text": Fancy <em>Hotel</em>
                    description: Best hotel in town
                    docId: "2"
                    title: Fancy Hotel
      x-ms-request-id: request-id
definitions:
  AutocompleteItem:
    description: The result of Autocomplete requests.
    properties:
      queryPlusText:
        description: The query along with the completed term.
        readOnly: true
        type: string
      text:
        description: The completed term.
        readOnly: true
        type: string
  AutocompleteMode:
    description: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context in producing autocomplete terms.
    enum:
      - oneTerm
      - twoTerms
      - oneTermWithContext
    type: string
    x-ms-enum:
      modelAsString: false
      name: AutocompleteMode
  AutocompleteRequest:
    description: Parameters for fuzzy matching, and other autocomplete query behaviors.
    properties:
      autocompleteMode:
        $ref: "#/definitions/AutocompleteMode"
        description: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms.
      filter:
        description: An OData expression that filters the documents used to produce completed terms for the Autocomplete result.
        externalDocs:
          url: https://docs.microsoft.com/rest/api/searchservice/OData-Expression-Syntax-for-Azure-Search
        type: string
      fuzzy:
        description: A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will autocomplete terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources.
        type: boolean
        x-ms-client-name: UseFuzzyMatching
      highlightPostTag:
        description: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled.
        type: string
      highlightPreTag:
        description: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled.
        type: string
      minimumCoverage:
        description: A number between 0 and 100 indicating the percentage of the index that must be covered by an autocomplete query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80.
        format: double
        type: number
      search:
        description: The search text on which to base autocomplete results.
        type: string
        x-ms-client-name: SearchText
      searchFields:
        description: The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.
        type: string
      suggesterName:
        description: The name of the suggester as specified in the suggesters collection that's part of the index definition.
        type: string
      top:
        description: The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5.
        format: int32
        type: integer
  AutocompleteResult:
    description: The result of Autocomplete query.
    properties:
      value:
        description: The list of returned Autocompleted items.
        items:
          $ref: "#/definitions/AutocompleteItem"
        readOnly: true
        type: array
        x-ms-client-name: Results
  DocumentIndexResult:
    description: Response containing the status of operations for all documents in the indexing request.
    properties:
      value:
        description: The list of status information for each document in the indexing request.
        items:
          $ref: "#/definitions/IndexingResult"
        readOnly: true
        type: array
        x-ms-client-name: Results
  DocumentSearchResult:
    description: Response containing search results from an index.
    properties:
      "@odata.count":
        description: The total count of results found by the search operation, or null if the count was not requested. If present, the count may be greater than the number of results in this response. This can happen if you use the $top or $skip parameters, or if Azure Cognitive Search can't return all the requested documents in a single Search response.
        format: int64
        readOnly: true
        type: integer
        x-ms-client-name: Count
      "@odata.nextLink":
        description: Continuation URL returned when Azure Cognitive Search can't return all the requested results in a single Search response. You can use this URL to formulate another GET or POST Search request to get the next part of the search response. Make sure to use the same verb (GET or POST) as the request that produced this response.
        readOnly: true
        type: string
        x-ms-client-name: NextLink
      "@search.coverage":
        description: A value indicating the percentage of the index that was included in the query, or null if minimumCoverage was not specified in the request.
        format: double
        readOnly: true
        type: number
        x-ms-client-name: Coverage
      "@search.facets":
        additionalProperties:
          items:
            $ref: "#/definitions/FacetResult"
          type: array
        description: The facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not include any facet expressions.
        readOnly: true
        type: object
        x-ms-client-name: Facets
      "@search.nextPageParameters":
        $ref: "#/definitions/SearchRequest"
        description: Continuation JSON payload returned when Azure Cognitive Search can't return all the requested results in a single Search response. You can use this JSON along with @odata.nextLink to formulate another POST Search request to get the next part of the search response.
        readOnly: true
        x-ms-client-name: NextPageParameters
      value:
        description: The sequence of results returned by the query.
        items:
          $ref: "#/definitions/SearchResult"
        readOnly: true
        type: array
        x-ms-client-name: Results
  DocumentSuggestResult:
    description: Response containing suggestion query results from an index.
    properties:
      "@search.coverage":
        description: A value indicating the percentage of the index that was included in the query, or null if minimumCoverage was not set in the request.
        format: double
        readOnly: true
        type: number
        x-ms-client-name: Coverage
      value:
        description: The sequence of results returned by the query.
        items:
          $ref: "#/definitions/SuggestResult"
        readOnly: true
        type: array
        x-ms-client-name: Results
  FacetResult:
    additionalProperties: true
    description: A single bucket of a facet query result. Reports the number of documents with a field value falling within a particular range or having a particular value or interval.
    properties:
      count:
        description: The approximate count of documents falling within the bucket described by this facet.
        format: int64
        readOnly: true
        type: integer
  IndexAction:
    additionalProperties: true
    description: Represents an index action that operates on a document.
    properties:
      "@search.action":
        description: The operation to perform on a document in an indexing batch.
        enum:
          - upload
          - merge
          - mergeOrUpload
          - delete
        type: string
        x-ms-client-name: ActionType
        x-ms-enum:
          name: IndexActionType
        x-nullable: false
  IndexBatch:
    description: Contains a batch of document write actions to send to the index.
    properties:
      value:
        description: The actions in the batch.
        items:
          $ref: "#/definitions/IndexAction"
        type: array
        x-ms-client-name: Actions
    required:
      - value
  IndexingResult:
    description: Status of an indexing operation for a single document.
    properties:
      errorMessage:
        description: The error message explaining why the indexing operation failed for the document identified by the key; null if indexing succeeded.
        readOnly: true
        type: string
      key:
        description: The key of a document that was in the indexing request.
        readOnly: true
        type: string
      status:
        description: A value indicating whether the indexing operation succeeded for the document identified by the key.
        readOnly: true
        type: boolean
        x-ms-client-name: Succeeded
        x-nullable: false
      statusCode:
        description: "The status code of the indexing operation. Possible values include: 200 for a successful update or delete, 201 for successful document creation, 400 for a malformed input document, 404 for document not found, 409 for a version conflict, 422 when the index is temporarily unavailable, or 503 for when the service is too busy."
        format: int32
        readOnly: true
        type: integer
        x-nullable: false
  QueryType:
    description: Specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax.
    enum:
      - simple
      - full
    type: string
    x-ms-enum:
      modelAsString: false
      name: QueryType
  SearchMode:
    description: Specifies whether any or all of the search terms must be matched in order to count the document as a match.
    enum:
      - any
      - all
    type: string
    x-ms-enum:
      modelAsString: false
      name: SearchMode
  SearchRequest:
    description: Parameters for filtering, sorting, faceting, paging, and other search query behaviors.
    properties:
      count:
        description: A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation.
        type: boolean
        x-ms-client-name: IncludeTotalResultCount
      facets:
        description: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs.
        externalDocs:
          url: https://docs.microsoft.com/rest/api/searchservice/Search-Documents
        items:
          type: string
        type: array
      filter:
        description: The OData $filter expression to apply to the search query.
        externalDocs:
          url: https://docs.microsoft.com/rest/api/searchservice/OData-Expression-Syntax-for-Azure-Search
        type: string
      highlight:
        description: The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting.
        type: string
        x-ms-client-name: HighlightFields
      highlightPostTag:
        description: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is &lt;/em&gt;.
        type: string
      highlightPreTag:
        description: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is &lt;em&gt;.
        type: string
      minimumCoverage:
        description: A number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100.
        format: double
        type: number
      orderby:
        description: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses.
        type: string
        x-ms-client-name: OrderBy
      queryType:
        $ref: "#/definitions/QueryType"
        description: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax.
      scoringParameters:
        description: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes).
        items:
          type: string
        type: array
      scoringProfile:
        description: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results.
        type: string
      search:
        description: A full-text search query expression; Use "*" or omit this parameter to match all documents.
        type: string
        x-ms-client-name: SearchText
      searchFields:
        description: The comma-separated list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter.
        type: string
      searchMode:
        $ref: "#/definitions/SearchMode"
        description: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match.
      select:
        description: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included.
        type: string
      skip:
        description: The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use skip due to this limitation, consider using orderby on a totally-ordered key and filter with a range query instead.
        format: int32
        type: integer
      top:
        description: The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results.
        format: int32
        type: integer
  SearchResult:
    additionalProperties: true
    description: Contains a document found by a search query, plus associated metadata.
    properties:
      "@search.highlights":
        additionalProperties:
          items:
            type: string
          type: array
        description: Text fragments from the document that indicate the matching search terms, organized by each applicable field; null if hit highlighting was not enabled for the query.
        readOnly: true
        type: object
        x-ms-client-name: Highlights
      "@search.score":
        description: The relevance score of the document compared to other documents returned by the query.
        format: double
        readOnly: true
        type: number
        x-ms-client-name: Score
        x-nullable: false
  SuggestRequest:
    description: Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors.
    properties:
      filter:
        description: An OData expression that filters the documents considered for suggestions.
        externalDocs:
          url: https://docs.microsoft.com/rest/api/searchservice/OData-Expression-Syntax-for-Azure-Search
        type: string
      fuzzy:
        description: A value indicating whether to use fuzzy matching for the suggestion query. Default is false. When set to true, the query will find suggestions even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and consume more resources.
        type: boolean
        x-ms-client-name: UseFuzzyMatching
      highlightPostTag:
        description: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled.
        type: string
      highlightPreTag:
        description: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled.
        type: string
      minimumCoverage:
        description: A number between 0 and 100 indicating the percentage of the index that must be covered by a suggestion query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80.
        format: double
        type: number
      orderby:
        description: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses.
        type: string
        x-ms-client-name: OrderBy
      search:
        description: The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters.
        type: string
        x-ms-client-name: SearchText
      searchFields:
        description: The comma-separated list of field names to search for the specified search text. Target fields must be included in the specified suggester.
        type: string
      select:
        description: The comma-separated list of fields to retrieve. If unspecified, only the key field will be included in the results.
        type: string
      suggesterName:
        description: The name of the suggester as specified in the suggesters collection that's part of the index definition.
        type: string
      top:
        description: The number of suggestions to retrieve. This must be a value between 1 and 100. The default is 5.
        format: int32
        type: integer
  SuggestResult:
    additionalProperties: true
    description: A result containing a document found by a suggestion query, plus associated metadata.
    properties:
      "@search.text":
        description: The text of the suggestion result.
        readOnly: true
        type: string
        x-ms-client-name: Text
x-ms-parameterized-host:
  hostTemplate: https://{searchServiceName}.{searchDnsSuffix}/indexes('{indexName}')
  parameters:
    - $ref: "#/parameters/SearchServiceNameParameter"
    - $ref: "#/parameters/SearchDnsSuffixParameter"
    - $ref: "#/parameters/IndexNameParameter"
  useSchemePrefix: false
