Skip to content

Commit ed9fec1

Browse files
committed
Prep for publish
1 parent 67fc5e1 commit ed9fec1

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

articles/search/query-simple-syntax.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: brjohnstmsft
88
ms.author: brjohnst
99
ms.service: cognitive-search
1010
ms.topic: conceptual
11-
ms.date: 02/10/2020
11+
ms.date: 04/03/2020
1212
translation.priority.mt:
1313
- "de-de"
1414
- "es-es"
@@ -64,9 +64,13 @@ The NOT operator is a minus sign. For example, `wifi –luxury` will search for
6464
> [!NOTE]
6565
> The `searchMode` option controls whether a term with the NOT operator is ANDed or ORed with the other terms in the query in the absence of a `+` or `|` operator. Recall that `searchMode` can be set to either `any` (default) or `all`. If you use `any`, it will increase 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`. If you use `all`, it will increase 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.
6666
67-
## Suffix operator
67+
<a name="prefix-search"></a>
6868

69-
The suffix operator is an asterisk `*`. For example, `lux*` will search for documents that have a term that starts with `lux`, ignoring case.
69+
## Suffix `*` operator for prefix search
70+
71+
The suffix operator is an asterisk `*`. For example, `cap*` will search for documents that have a term that starts with `cap`, ignoring case.
72+
73+
Similar to filters, a prefix query looks for an exact match. As such, there is no relevance scoring (all results receive a search score of 1.0). Prefix queries can be slow, especially if the index is large and the prefix consists of a small number of characters.
7074

7175
## Phrase search operator
7276

articles/search/search-pagination-page-layout.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ Search scores convey general sense of relevance, reflecting the strength of matc
7777
| Cause | Description |
7878
|-----------|-------------|
7979
| Data volatility | Index content varies as you add, modify, or delete documents. Term frequencies will change as index updates are processed over time, affecting the search scores of matching documents. |
80-
| Multiple replicas | For services using multiple replicas, queries are issued against each replica in parallel. The index statistics used to calculate a search score are calculated on a per-replica basis, with results merged and ordered in the query response. Replicas are mostly mirrors of each other, but statistics can differ due to small differences in state. For example, one replica might have deleted documents contributing to their statistics, which were merged out of other replicas. Generally, differences in per-replica statistics are more noticeable in smaller indexes. |
81-
| Identical scores | If two or more search documents have identical scores, any one of them might appear first. |
80+
| Multiple replicas | For services using multiple replicas, queries are issued against each replica in parallel. The index statistics used to calculate a search score are calculated on a per-replica basis, with results merged and ordered in the query response. Replicas are mostly mirrors of each other, but statistics can differ due to small differences in state. For example, one replica might have deleted documents contributing to their statistics, which were merged out of other replicas. Typically, differences in per-replica statistics are more noticeable in smaller indexes. |
81+
| Identical scores | If multiple documents have the same score, any one of them might appear first. |
8282

8383
### Consistent ordering
8484

articles/search/search-query-partial-matching.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ ms.date: 04/02/2020
1414

1515
A *partial term search* refers to queries consisting of term fragments, such as the first, last, or interior parts of a string, or a pattern consisting of a combination of fragments, often separated by special characters such as dashes or slashes. Common use-cases include querying for portions of a phone number, URL, people or product codes, or compound words.
1616

17-
Partial search can be problematic because the index itself does not typically store terms in a way that is conducive to partial string and pattern matching. During the text analysis phase of indexing, special characters are discarded, composite and compound strings are split up, causing pattern queries to fail when no match is found. For example, a phone number like `+1 (425) 703-6214`( tokenized as `"1"`, `"425"`, `"703"`, `"6214"`) won't show up in a `"3-62"` query because that content doesn't actually exist in the index.
17+
Partial search can be problematic because the index itself does not typically store terms in a way that is conducive to partial string and pattern matching. During the text analysis phase of indexing, special characters are discarded, composite and compound strings are split up, causing pattern queries to fail when no match is found. For example, a phone number like `+1 (425) 703-6214`(tokenized as `"1"`, `"425"`, `"703"`, `"6214"`) won't show up in a `"3-62"` query because that content doesn't actually exist in the index.
1818

1919
The solution is to store intact versions of these strings in the index so that you can support partial search scenarios. Creating an additional field for an intact string, plus using a content-preserving analyzer, is the basis of the solution.
2020

2121
## What is partial search in Azure Cognitive Search
2222

2323
In Azure Cognitive Search, partial search is available in these forms:
2424

25-
+ [Simple query expressions](query-simple-syntax.md) that use a fragment of string, such as the `"3-62"` example above.
26-
+ [Wildcard or prefix search](query-lucene-syntax.md#bkmk_wildcard), such as `search=sea~`, matching on "seaside", "Seattle", "seam". Or `search=*sea*`, matching on "Seattle" or "Swansea".
27-
+ [Regular expressions](query-lucene-syntax.md#bkmk_regex) that search for a pattern.
25+
+ [Prefix search](query-simple-syntax.md#prefix-search), such as `search=cap*`, matching on "Cap'n Jack's Waterfront Inn" or "Gacc Capital". You can use the simply query syntax for prefix search.
26+
+ [Wildcard search](query-lucene-syntax.md#bkmk_wildcard) or [Regular expressions](query-lucene-syntax.md#bkmk_regex) that search for a pattern or parts of an embedded string, including the suffix. For example, given the term "alphanumeric", you would use a wildcard search (`search=/.*numeric.*/`) for a suffix query. Wildcard and regular expressions require the full Lucene syntax.
2827

2928
When any of the above query types are needed in your client application, follow the steps in this article to ensure the necessary content exists in your index.
3029

0 commit comments

Comments
 (0)