Skip to content

Commit d43b405

Browse files
Merge pull request #1930 from HeidiSteen/heidist-dec
[azure search] regex is lower-case
2 parents dd9b74a + 8092f82 commit d43b405

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

articles/search/query-lucene-syntax.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.service: azure-ai-search
1010
ms.custom:
1111
- ignite-2023
1212
ms.topic: concept-article
13-
ms.date: 09/19/2024
13+
ms.date: 12/11/2024
1414
---
1515

1616
# Lucene query syntax in Azure AI Search
@@ -136,9 +136,14 @@ The following example helps illustrate the differences. Suppose that there's a s
136136

137137
## <a name="bkmk_regex"></a> Regular expression search
138138

139-
A regular expression search finds a match based on patterns that are valid under Apache Lucene, as documented in the [RegExp class](https://lucene.apache.org/core/6_6_1/core/org/apache/lucene/util/automaton/RegExp.html). In Azure AI Search, a regular expression is enclosed between forward slashes `/`.
139+
A regular expression search finds a match based on patterns that are valid under Apache Lucene, as documented in the [RegExp class](https://lucene.apache.org/core/6_6_1/core/org/apache/lucene/util/automaton/RegExp.html).
140140

141-
For example, to find documents containing `motel` or `hotel`, specify `/[mh]otel/`. Regular expression searches are matched against single words.
141+
In Azure AI Search, a regular expression is:
142+
143+
* Enclosed between forward slashes `/`
144+
* Lower-case only
145+
146+
For example, to find documents containing `motel` or `hotel`, specify `/[mh]otel/`. Regular expression searches are matched against single words.
142147

143148
Some tools and languages impose extra escape character requirements beyond the [escape rules](#escaping-special-characters) imposed by Azure AI Search. For JSON, strings that include a forward slash are escaped with a backward slash: `microsoft.com/azure/` becomes `search=/.*microsoft.com\/azure\/.*/` where `search=/.* <string-placeholder>.*/` sets up the regular expression, and `microsoft.com\/azure\/` is the string with an escaped forward slash.
144149

articles/search/search-query-lucene-examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ After you boost the term *beach*, the match on Campus Commander Hotel moves down
391391

392392
## Example 5: Regex
393393

394-
A regular expression search finds a match based on the contents between forward slashes `/`, as documented in the [RegExp class](https://lucene.apache.org/core/6_6_1/core/org/apache/lucene/util/automaton/RegExp.html).
394+
A regular expression search finds a match based on the contents between forward slashes `/` and lower-case strings, as documented in the [RegExp class](https://lucene.apache.org/core/6_6_1/core/org/apache/lucene/util/automaton/RegExp.html).
395395

396396
```http
397397
POST /indexes/hotel-samples-index/docs/search?api-version=2024-07-01

0 commit comments

Comments
 (0)