Skip to content

Commit 620123e

Browse files
committed
checkpoint
1 parent 25216d0 commit 620123e

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

articles/search/query-lucene-syntax.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,15 @@ The AND operator is an ampersand or a plus sign. For example: `wifi && luxury` w
115115

116116
### NOT operator `NOT`, `!` or `-`
117117

118-
The NOT operator is an exclamation point or the minus sign. For example: `wifi !luxury` will search for documents that have the "wifi" term and/or do not have "luxury". The `searchMode` setting controls whether a term with the NOT operator is ANDed or ORed with the other terms in the query, assuming the absence of additional `+` or `|` operators on the other terms.
118+
The NOT operator is a minus sign. For example, `wifi luxury` will search for documents that have the `wifi` term and/or do not have `luxury`.
119119

120-
`searchMode` is a parameter that specifies whether any or all of the search terms must be matched in order to count the document as a match. On a NOT query, this parameter has a profound effect on query logic.
120+
The **searchMode** parameter on a query request controls whether a term with the NOT operator is ANDed or ORed with other terms in the query (assuming there is no `+` or `|` operator on the other terms). Valid values include `any` or `all`.
121121

122-
|searchMode setting| Effect | Example |
123-
|------------------|--------|--------|
124-
|`any` (default) | Increases the recall of queries by returning more results, and by default will be interpreted as "OR NOT". | `search=wifi -luxury` will match documents that either contain the term *wifi* or those that do not contain the term *luxury*. |
125-
|`all` | Increases the precision of queries by including fewer results, and by default will be interpreted as "AND NOT". | `search=wifi -luxury` will match documents that either contain the term *wifi* or those that do not contain the term *luxury*. This is arguably a more intuitive behavior for the `-` operator. Therefore, you should consider choosing `searchMode=all` over `searchMode=any` if you want to optimize searches for precision instead of recall *and* your users frequently use the `-` operator in searches.|
122+
`searchMode=any` increases the recall of queries by including more results, and by default `-` will be interpreted as "OR NOT". For example, `wifi -luxury` will match documents that either contain the term `wifi` or those that do not contain the term `luxury`.
126123

127-
Using `searchMode=any` increases the recall of queries by returning more results, and by default will be interpreted as "OR NOT". For example, `wifi -luxury` will match documents that either contain the term *wifi* or those that do not contain the term *luxury.*
124+
`searchMode=all` increases the precision of queries by including fewer results, and by default - will be interpreted as "AND NOT". For example, `wifi -luxury` will match documents that contain the term `wifi` and do not contain the term "luxury". This is arguably a more intuitive behavior for the `-` operator. Therefore, you should consider using `searchMode=all` instead of `searchMode=any` if you want to optimize searches for precision instead of recall, *and* Your users frequently use the `-` operator in searches.
128125

129-
Using `searchMode=all` increases the precision of queries by including fewer results, and by default will be interpreted as "AND NOT". For example, `wifi -luxury` will match documents that contain the term `wifi` and do not contain the term `luxury`. This is arguably a more intuitive behavior for the - operator. Therefore, you should consider choosing `searchMode=all` over `searchMode=any` if you want to optimize searches for precision instead of recall *and* your users frequently use the `-` operator in searches.
126+
When deciding on a **searchMode** setting, consider the user interaction patterns for queries in various applications. Users who are searching for information are more likely to include an operator in a query, as opposed to e-commerce sites that have more built-in navigation structures.
130127

131128
## <a name="bkmk_fields"></a> Fielded search
132129

@@ -186,8 +183,10 @@ Suffix search, where `*` or `?` precedes the string, requires full Lucene syntax
186183

187184
Azure Cognitive Search uses frequency-based scoring ([TF-IDF](https://en.wikipedia.org/wiki/Tf%E2%80%93idf)) for text queries. However, for wildcard and regex queries where scope of terms can potentially be broad, the frequency factor is ignored to prevent the ranking from biasing towards matches from rarer terms. All matches are treated equally for wildcard and regex searches.
188185

189-
## See also
186+
## See also
190187

188+
+ [Query examples for simple search](search-query-simple-examples.md)
189+
+ [Query examples for full Lucene search](search-query-lucene-examples.md)
191190
+ [Search Documents](https://docs.microsoft.com/rest/api/searchservice/Search-Documents)
192191
+ [OData expression syntax for filters and sorting](query-odata-filter-orderby-syntax.md)
193192
+ [Simple query syntax in Azure Cognitive Search](query-simple-syntax.md)

articles/search/query-simple-syntax.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Simple syntax is the default. Invocation is only necessary if you are resetting
2828

2929
Any text with one or more terms is considered a valid starting point for query execution. Azure Cognitive Search will match documents containing any or all of the terms, including any variations found during analysis of the text.
3030

31-
As straightforward as this sounds, there is one aspect of query execution in Azure Cognitive Search that *might* produce unexpected results, increasing rather than decreasing search results as more terms and operators are added to the input string. Whether this expansion actually occurs depends on the inclusion of a NOT operator, combined with a `searchMode` parameter setting that determines how NOT is interpreted in terms of AND or OR behaviors. For more information, see [NOT operator](#not-operator).
31+
As straightforward as this sounds, there is one aspect of query execution in Azure Cognitive Search that *might* produce unexpected results, increasing rather than decreasing search results as more terms and operators are added to the input string. Whether this expansion actually occurs depends on the inclusion of a NOT operator, combined with a **searchMode** parameter setting that determines how NOT is interpreted in terms of AND or OR behaviors. For more information, see [NOT operator](#not-operator).
3232

3333
### Precedence operators (grouping)
3434

@@ -103,6 +103,8 @@ The phrase operator encloses a phrase in quotation marks `" "`. For example, whi
103103

104104
## See also
105105

106-
+ [Search Documents &#40;Azure Cognitive Search REST API&#41;](https://docs.microsoft.com/rest/api/searchservice/Search-Documents)
106+
+ [Query examples for simple search](search-query-simple-examples.md)
107+
+ [Query examples for full Lucene search](search-query-lucene-examples.md)
108+
+ [Search Documents &#40;Azure Cognitive Search REST API&#41;](https://docs.microsoft.com/rest/api/searchservice/Search-Documents)
107109
+ [Lucene query syntax](query-lucene-syntax.md)
108110
+ [OData expression syntax](query-odata-filter-orderby-syntax.md)

articles/search/search-autocomplete-tutorial.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ ms.author: heidist
99
ms.service: cognitive-search
1010
ms.topic: conceptual
1111
ms.date: 04/10/2020
12-
1312
---
1413

1514
# Add suggestions or autocomplete to your Azure Cognitive Search application
1615

17-
In this example, learn how to build a search box that supports search-as-you-type behaviors. There are two features, which you can use together or separately:
16+
This example demonstrates a search box that supports search-as-you-type behaviors. There are two features, which you can use together or separately:
1817

1918
+ *Suggestions* generate search results as you type, where each suggestion is a single result or search document from the index that matches what you've typed so far.
2019

@@ -32,7 +31,7 @@ For both language versions, the front-end user experience is based on the [jQuer
3231

3332
+ [Visual Studio](https://visualstudio.microsoft.com/downloads/)
3433

35-
An Azure Cognitive Search service is optional for this exercise because the solution uses a hosted service hosting and NYCJobs demo index. If you want to build this index on your own search service, see [Create NYC Jobs index](#configure-app) for instructions.
34+
An Azure Cognitive Search service is optional for this exercise because the solution uses a hosted service and NYCJobs demo index. If you want to build this index on your own search service, see [Create NYC Jobs index](#configure-app) for instructions. Otherwise, you can use the existing service and index to back a JavaScript client app.
3635

3736
<!-- The sample is comprehensive, covering suggestions, autocomplete, faceted navigation, and client-side caching. Review the readme and comments for a full description of what the sample offers. -->
3837

@@ -320,5 +319,4 @@ As a next step, trying integrating suggestions and autocomplete into your search
320319
> [!div class="nextstepaction"]
321320
> [Autocomplete REST API](https://docs.microsoft.com/rest/api/searchservice/autocomplete)
322321
> [Suggestions REST API](https://docs.microsoft.com/rest/api/searchservice/suggestions)
323-
> [Facets index attribute on a Create Index REST API](https://docs.microsoft.com/rest/api/searchservice/create-index)
324-
322+
> [Facets index attribute on a Create Index REST API](https://docs.microsoft.com/rest/api/searchservice/create-index)

0 commit comments

Comments
 (0)