You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/query-lucene-syntax.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,18 +115,15 @@ The AND operator is an ampersand or a plus sign. For example: `wifi && luxury` w
115
115
116
116
### NOT operator `NOT`, `!` or `-`
117
117
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`.
119
119
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`.
121
121
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`.
126
123
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.
128
125
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.
130
127
131
128
## <aname="bkmk_fields"></a> Fielded search
132
129
@@ -186,8 +183,10 @@ Suffix search, where `*` or `?` precedes the string, requires full Lucene syntax
186
183
187
184
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.
188
185
189
-
## See also
186
+
## See also
190
187
188
+
+[Query examples for simple search](search-query-simple-examples.md)
189
+
+[Query examples for full Lucene search](search-query-lucene-examples.md)
Copy file name to clipboardExpand all lines: articles/search/query-simple-syntax.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Simple syntax is the default. Invocation is only necessary if you are resetting
28
28
29
29
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.
30
30
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).
32
32
33
33
### Precedence operators (grouping)
34
34
@@ -103,6 +103,8 @@ The phrase operator encloses a phrase in quotation marks `" "`. For example, whi
Copy file name to clipboardExpand all lines: articles/search/search-autocomplete-tutorial.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,12 +9,11 @@ ms.author: heidist
9
9
ms.service: cognitive-search
10
10
ms.topic: conceptual
11
11
ms.date: 04/10/2020
12
-
13
12
---
14
13
15
14
# Add suggestions or autocomplete to your Azure Cognitive Search application
16
15
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:
18
17
19
18
+*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.
20
19
@@ -32,7 +31,7 @@ For both language versions, the front-end user experience is based on the [jQuer
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.
36
35
37
36
<!-- 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. -->
38
37
@@ -320,5 +319,4 @@ As a next step, trying integrating suggestions and autocomplete into your search
0 commit comments