diff --git a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/examples/SearchIndexSearchDocumentsGet.json b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/examples/SearchIndexSearchDocumentsGet.json index 0bc9ad4e6522..d3eff019e3ac 100644 --- a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/examples/SearchIndexSearchDocumentsGet.json +++ b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/examples/SearchIndexSearchDocumentsGet.json @@ -20,6 +20,9 @@ "rating desc" ], "queryType": "simple", + "sessionId": "mysessionid", + "featuresMode": "enabled", + "scoringStatistics": "global", "scoringParameters": [ "currentLocation--122.123,44.77233" ], @@ -74,6 +77,16 @@ "Fancy Hotel" ] }, + "@search.features": { + "description": { + "uniqueTokenMatches": 1.0, + "similarityScore": 0.023745812 + }, + "title": { + "uniqueTokenMatches": 1.0, + "similarityScore": 0.016049799 + } + }, "description": "Best hotel in town", "docId": "2", "title": "Fancy Hotel" diff --git a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/examples/SearchIndexSearchDocumentsPost.json b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/examples/SearchIndexSearchDocumentsPost.json index 732a0a19680a..c95e8c51acd2 100644 --- a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/examples/SearchIndexSearchDocumentsPost.json +++ b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/examples/SearchIndexSearchDocumentsPost.json @@ -23,6 +23,9 @@ "search": "nice hotels", "searchFields": "title,description", "searchMode": "any", + "sessionId": "mysessionid", + "featuresMode": "enabled", + "scoringStatistics": "global", "select": "docId,title,description", "skip": 0, "top": 10 @@ -56,6 +59,9 @@ "minimumCoverage": null, "orderby": "search.score() desc,rating desc", "queryType": "simple", + "sessionId": "mysessionid", + "featuresMode": "enabled", + "scoringStatistics": "global", "scoringParameters": [ "currentLocation--122.123,44.77233" ], @@ -86,6 +92,16 @@ "Fancy Hotel" ] }, + "@search.features": { + "description": { + "uniqueTokenMatches": 1.0, + "similarityScore": 0.023745812 + }, + "title": { + "uniqueTokenMatches": 1.0, + "similarityScore": 0.016049799 + } + }, "description": "Best hotel in town", "docId": "2", "title": "Fancy Hotel" diff --git a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/searchindex.json b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/searchindex.json index b1cc8cbb9aac..073df28cd754 100644 --- a/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/searchindex.json +++ b/specification/search/data-plane/Microsoft.Azure.Search.Data/preview/2019-05-06-preview/searchindex.json @@ -248,6 +248,51 @@ "name": "SearchParameters" } }, + { + "name": "featuresMode", + "in": "query", + "type": "string", + "enum": [ + "disabled", + "enabled" + ], + "x-ms-enum": { + "name": "FeaturesMode", + "modelAsString": false + }, + "x-nullable": false, + "description": "A value that specifies whether the results should include scoring features such as per field similarity.", + "x-ms-parameter-grouping": { + "name": "SearchParameters" + } + }, + { + "name": "scoringStatistics", + "in": "query", + "type": "string", + "enum": [ + "local", + "global" + ], + "x-ms-enum": { + "name": "ScoringStatistics", + "modelAsString": false + }, + "x-nullable": false, + "description": "A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency.", + "x-ms-parameter-grouping": { + "name": "SearchParameters" + } + }, + { + "name": "sessionId", + "in": "query", + "type": "string", + "description": "A value to be used to create a sticky session, which can help to get more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character.", + "x-ms-parameter-grouping": { + "name": "SearchParameters" + } + }, { "name": "$select", "in": "query", @@ -857,6 +902,27 @@ "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." }, + "SearchFeatures": { + "properties": { + "uniqueTokenMatches": { + "type": "number", + "readOnly": true, + "format": "double", + "description": "The number of unique tokens from the search query that matched this field." + }, + "similarityScore": { + "type": "number", + "readOnly": true, + "format": "double", + "description": "The similarity score computed between the search query and this field." + } + }, + "required": [ + "uniqueTokenMatches", + "similarityScore" + ], + "description": "A list of features describing the scoring of a specific field against the search query." + }, "DocumentSearchResult": { "properties": { "@odata.count": { @@ -930,6 +996,15 @@ "readOnly": true, "x-ms-client-name": "Highlights", "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." + }, + "@search.features": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/SearchFeatures" + }, + "readOnly": true, + "x-ms-client-name": "Features", + "description": "description for the feature" } }, "additionalProperties": true, @@ -1039,6 +1114,30 @@ }, "description": "Specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax." }, + "FeaturesMode": { + "type": "string", + "enum": [ + "disabled", + "enabled" + ], + "x-ms-enum": { + "name": "FeaturesMode", + "modelAsString": false + }, + "description": "A value that specifies whether the results should include scoring features, such as per field similarity. The default is 'disabled'. Use 'enabled' to expose additional scoring features." + }, + "ScoringStatistics": { + "type": "string", + "enum": [ + "local", + "global" + ], + "x-ms-enum": { + "name": "ScoringStatistics", + "modelAsString": false + }, + "description": "A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries." + }, "AutocompleteMode": { "type": "string", "enum": [ @@ -1103,6 +1202,18 @@ "$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." }, + "featuresMode": { + "$ref": "#/definitions/FeaturesMode", + "description": "A value that specifies whether the results should include scoring features, such as per field similarity. The default is 'disabled'. Use 'enabled' to expose additional scoring features." + }, + "scoringStatistics": { + "$ref": "#/definitions/ScoringStatistics", + "description": "A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries." + }, + "sessionId": { + "type": "string", + "description": "A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character." + }, "scoringParameters": { "type": "array", "items": {