diff --git a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/examples/SearchIndexGetAutocomplete.json b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/examples/SearchIndexGetAutocomplete.json new file mode 100644 index 000000000000..2ddae016840d --- /dev/null +++ b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/examples/SearchIndexGetAutocomplete.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "searchServiceName": "myservice", + "searchDnsSuffix": "search.windows.net", + "indexName": "myindex", + "api-version": "2017-11-11-Preview", + "autocompleteMode": "oneTerm", + "search": "washington medic", + "suggesterName": "sg", + "fuzzy": false, + "highlightPostTag": "", + "highlightPreTag": "", + "minimumCoverage": 80, + "searchFields": "title,description", + "top": "10" + }, + "responses": { + "200": { + "body": [ + { + "text": "medicaid", + "queryPlusText": "washington medicaid" + }, + { + "text": "medicare", + "queryPlusText": "washington medicare" + }, + { + "text": "medicine", + "queryPlusText": "washington medicine" + } + ] + } + } +} \ No newline at end of file diff --git a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/examples/SearchIndexPostAutocomplete.json b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/examples/SearchIndexPostAutocomplete.json new file mode 100644 index 000000000000..41d9263200f6 --- /dev/null +++ b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/examples/SearchIndexPostAutocomplete.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "searchServiceName": "myservice", + "searchDnsSuffix": "search.windows.net", + "indexName": "myindex", + "api-version": "2017-11-11-Preview", + "autocompleteRequest": { + "autocompleteMode": "oneTerm", + "search": "washington medic", + "suggesterName": "sg", + "highlightPostTag": "", + "highlightPreTag": "", + "minimumCoverage": 80, + "searchFields": "title,description", + "top": "10" + } + }, + "responses": { + "200": { + "body": [ + { + "text": "medicaid", + "queryPlusText": "washington medicaid" + }, + { + "text": "medicare", + "queryPlusText": "washington medicare" + }, + { + "text": "medicine", + "queryPlusText": "washington medicine" + } + ] + } + } +} \ No newline at end of file diff --git a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/searchindex.json b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/searchindex.json index 84f3da2b78e4..50694a7fcd68 100644 --- a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/searchindex.json +++ b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2017-11-11-preview/searchindex.json @@ -63,6 +63,162 @@ } } } + }, + "/docs/autocomplete": { + "get": { + "tags": [ + "Autocomplete" + ], + "operationId": "DocumentsProxy_AutocompleteGet", + "x-ms-examples": { + "SearchIndexGetAutocomplete": { "$ref": "./examples/SearchIndexGetAutocomplete.json" } + }, + "description": "Autocompletes incomplete query terms based on input text and matching terms in the Azure Search index.", + "parameters": [ + { + "$ref": "#/parameters/ClientRequestIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "autocompleteMode", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "oneTerm", + "twoTerms", + "oneTermWithContext" + ], + "x-ms-enum": { + "name": "AutocompleteMode", + "modelAsString": false + }, + "description": "Autocomplete mode." + }, + { + "name":"search", + "in": "query", + "type": "string", + "description": "The incomplete term which should be auto-completed." + }, + { + "name":"suggesterName", + "in": "query", + "type": "string", + "description": "The name of the suggester as specified in the suggesters collection that's part of the index definition." + }, + { + "name":"fuzzy", + "in": "query", + "type": "boolean", + "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.", + "x-ms-parameter-grouping": { + "name": "AutocompleteParameters" + } + }, + { + "name":"highlightPostTag", + "in": "query", + "type": "string", + "description": "A string tag that is appended to hit highlights. Must be set with HighlightPreTag. If omitted, hit highlighting is disabled.", + "x-ms-parameter-grouping": { + "name": "AutocompleteParameters" + } + }, + { + "name":"highlightPreTag", + "in": "query", + "type": "string", + "description": "A string tag that is prepended to hit highlights. Must be set with HighlightPostTag. If omitted, hit highlighting is disabled.", + "x-ms-parameter-grouping": { + "name": "AutocompleteParameters" + } + }, + { + "name":"minimumCoverage", + "in": "query", + "type": "number", + "format": "double", + "description": "A number between 0 and 100 indicating the percentage of the index that must be covered by am 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.", + "x-ms-parameter-grouping": { + "name": "AutocompleteParameters" + } + }, + { + "name":"searchFields", + "in": "query", + "type": "array", + "items": { + "type": "string" + }, + "description": "The comma-separated list of field names to consider when querying for auto-completed terms.", + "x-ms-parameter-grouping": { + "name": "AutocompleteParameters" + } + }, + { + "name":"$top", + "in": "query", + "type": "integer", + "format": "int32", + "description": "The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is to 5.", + "x-ms-parameter-grouping": { + "name": "AutocompleteParameters" + } + } + ], + "x-ms-request-id": "request-id", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/AutocompleteResult", + "description": "The result of Autocomplete query." + } + } + } + }, + "post": { + "tags": [ + "Autocomplete" + ], + "operationId": "DocumentsProxy_AutocompletePost", + "x-ms-examples": { + "SearchIndexPostAutocomplete": { "$ref": "./examples/SearchIndexPostAutocomplete.json" } + }, + "description": "Autocompletes incomplete query terms based on input text and matching terms in the Azure Search index.", + "parameters": [ + { + "$ref": "#/parameters/ClientRequestIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "AutocompleteRequest", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AutocompleteRequest", + "description": "The Autocomplete request." + }, + "description": "The definition of the Autocomplete request." + } + ], + "x-ms-request-id": "request-id", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/AutocompleteResult", + "description": "The result of Autocomplete query." + } + } + } + } + } }, "definitions": { @@ -138,6 +294,17 @@ "x-ms-enum": { "name": "QueryType" }, "description": "Specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax." }, + "AutocompleteMode": { + "type": "string", + "enum": [ + "oneTerm", + "twoTerms", + "oneTermWithContext" + ], + "x-ms-enum": { "name": "AutocompleteMode", + "modelAsString" : false }, + "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." + }, "SearchParametersPayload": { "properties": { "count": { @@ -287,6 +454,76 @@ } }, "description": "Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors." + }, + "AutocompleteRequest": { + "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." + }, + "fuzzy": { + "type": "boolean", + "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." + }, + "highlightPostTag": { + "type": "string", + "description": "A string tag that is appended to hit highlights. Must be set with HighlightPreTag. If omitted, hit highlighting is disabled." + }, + "highlightPreTag": { + "type": "string", + "description": "A string tag that is prepended to hit highlights. Must be set with HighlightPostTag. If omitted, hit highlighting is disabled." + }, + "minimumCoverage": { + "type": "number", + "format": "double", + "description": "A number between 0 and 100 indicating the percentage of the index that must be covered by am 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." + }, + "search": { + "type": "string", + "description": "The search text on which to base autocomplete results." + }, + "searchFields": { + "type": "string", + "description": "The comma-separated list of field names to consider when querying for auto-completed terms." + }, + "suggesterName": { + "type": "string", + "description": "The name of the suggester as specified in the suggesters collection that's part of the index definition." + }, + "top": { + "type": "integer", + "format": "int32", + "description": "The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is to 5." + } + }, + "description": "Parameters for fuzzy matching, and other autocomplete query behaviors." + }, + "AutocompleteResult" : { + "properties": { + "value": { + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/AutocompleteItem" + }, + "description": "The list of returned Autocompleted items.", + "x-ms-client-name": "Results" + } + }, + "description": "The result of Autocomlete query." + }, + "AutocompleteItem": { + "properties": { + "text": { + "type": "string", + "description": "The completed term." + }, + "queryPlusText": { + "type": "string", + "description": "The query along with the completed term." + } + }, + "description": "The result of Autocomplete requests." } }, "parameters": {