Skip to content

Commit 8ae3230

Browse files
Apply suggestions from code review
1 parent 389323c commit 8ae3230

File tree

5 files changed

+5
-27
lines changed

5 files changed

+5
-27
lines changed

docs/reference/data-analysis/aggregations/search-aggregations-bucket-adjacency-matrix-aggregation.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,8 @@ The response contains buckets with document counts for each filter and combinati
8787
}
8888
}
8989
```
90-
9190
% TESTRESPONSE[s/"took": 9/"took": $body.took/]
92-
9391
% TESTRESPONSE[s/"_shards": \.\.\./"_shards": $body._shards/]
94-
9592
% TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
9693

9794

docs/reference/data-analysis/aggregations/search-aggregations-bucket-autodatehistogram-aggregation.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ POST /sales/_search?size=0
2828
}
2929
}
3030
```
31-
3231
% TEST[setup:sales]
3332

3433
## Keys [_keys]
@@ -56,7 +55,6 @@ POST /sales/_search?size=0
5655
}
5756
}
5857
```
59-
6058
% TEST[setup:sales]
6159

6260
1. Supports expressive date [format pattern](/reference/data-analysis/aggregations/search-aggregations-bucket-daterange-aggregation.md#date-format-pattern)
@@ -91,7 +89,6 @@ Response:
9189
}
9290
}
9391
```
94-
9592
% TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
9693

9794

@@ -188,7 +185,6 @@ UTC is used if no time zone is specified, three 1-hour buckets are returned star
188185
}
189186
}
190187
```
191-
192188
% TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
193189

194190
If a `time_zone` of `-01:00` is specified, then midnight starts at one hour before midnight UTC:
@@ -207,7 +203,6 @@ GET my-index-000001/_search?size=0
207203
}
208204
}
209205
```
210-
211206
% TEST[continued]
212207

213208
Now three 1-hour buckets are still returned but the first bucket starts at 11:00pm on 30 September 2015 since that is the local time for the bucket in the specified time zone.
@@ -239,7 +234,6 @@ Now three 1-hour buckets are still returned but the first bucket starts at 11:00
239234
}
240235
}
241236
```
242-
243237
% TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
244238

245239
1. The `key_as_string` value represents midnight on each day in the specified time zone.
@@ -280,7 +274,6 @@ POST /sales/_search?size=0
280274
}
281275
}
282276
```
283-
284277
% TEST[setup:sales]
285278

286279

@@ -304,7 +297,6 @@ POST /sales/_search?size=0
304297
}
305298
}
306299
```
307-
308300
% TEST[setup:sales]
309301

310302
1. Documents without a value in the `publish_date` field will fall into the same bucket as documents that have the value `2000-01-01`.

docs/reference/data-analysis/aggregations/search-aggregations-bucket-children-aggregation.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ PUT child_example/_doc/1
5252
]
5353
}
5454
```
55-
5655
% TEST[continued]
5756

5857
Examples of `answer` documents:
@@ -88,7 +87,6 @@ PUT child_example/_doc/3?routing=1&refresh
8887
"creation_date": "2009-05-05T13:45:37.030"
8988
}
9089
```
91-
9290
% TEST[continued]
9391

9492
The following request can be built that connects the two together:
@@ -121,7 +119,6 @@ POST child_example/_search?size=0
121119
}
122120
}
123121
```
124-
125122
% TEST[continued]
126123

127124
1. The `type` points to type / mapping with the name `answer`.
@@ -222,7 +219,6 @@ Possible response:
222219
}
223220
}
224221
```
225-
226222
% TESTRESPONSE[s/"took": 25/"took": $body.took/]
227223

228224
1. The number of question documents with the tag `file-transfer`, `windows-server-2003`, etc.

docs/reference/data-analysis/aggregations/search-aggregations-bucket-composite-aggregation.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ For example, consider the following document:
8484
"number": [23, 65, 76]
8585
}
8686
```
87-
8887
% NOTCONSOLE
8988

9089
Using `keyword` and `number` as source fields for the aggregation results in the following composite buckets:
@@ -97,7 +96,6 @@ Using `keyword` and `number` as source fields for the aggregation results in the
9796
{ "keyword": "bar", "number": 65 }
9897
{ "keyword": "bar", "number": 76 }
9998
```
100-
10199
% NOTCONSOLE
102100

103101
## Value sources [_value_sources]
@@ -423,7 +421,6 @@ Instead of a single bucket starting at midnight, the above request groups the do
423421
}
424422
}
425423
```
426-
427424
% TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
428425

429426
::::{note}
@@ -628,7 +625,6 @@ GET /_search
628625
}
629626
}
630627
```
631-
632628
% TEST[s/_search/_search\?filter_path=aggregations/]
633629

634630
... returns:
@@ -662,7 +658,6 @@ GET /_search
662658
}
663659
}
664660
```
665-
666661
% TESTRESPONSE[s/\.\.\.//]
667662

668663
To get the next set of buckets, resend the same aggregation with the `after` parameter set to the `after_key` value returned in the response. For example, this request uses the `after_key` value provided in the previous response:
@@ -828,7 +823,6 @@ GET /_search
828823
}
829824
}
830825
```
831-
832826
% TEST[s/_search/_search\?filter_path=aggregations/]
833827

834828
... returns:
@@ -888,7 +882,6 @@ GET /_search
888882
}
889883
}
890884
```
891-
892885
% TESTRESPONSE[s/\.\.\.//]
893886

894887

docs/reference/elasticsearch/mapping-reference/search-as-you-type.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PUT my-index-000001/_doc/1?refresh
5151

5252
% TEST[continued]
5353

54-
The most efficient way of querying to serve a search-as-you-type use case is usually a [`multi_match`](query-dsl-multi-match-query.md) query of type [`bool_prefix`](query-dsl-match-bool-prefix-query.md) that targets the root `search_as_you_type` field and its shingle subfields. This can match the query terms in any order, but will score documents higher if they contain the terms in order in a shingle subfield.
54+
The most efficient way of querying to serve a search-as-you-type use case is usually a [`multi_match`](/reference/query-languages/query-dsl-multi-match-query.md) query of type [`bool_prefix`](/reference/query-languages/query-dsl-match-bool-prefix-query.md) that targets the root `search_as_you_type` field and its shingle subfields. This can match the query terms in any order, but will score documents higher if they contain the terms in order in a shingle subfield.
5555

5656
```console
5757
GET my-index-000001/_search
@@ -123,7 +123,7 @@ GET my-index-000001/_search
123123

124124
% TESTRESPONSE[s/"_score" : 0.8630463/"_score" : $body.hits.hits.0._score/]
125125

126-
To search for documents that strictly match the query terms in order, or to search using other properties of phrase queries, use a [`match_phrase_prefix` query](query-dsl-match-query-phrase-prefix.md) on the root field. A [`match_phrase` query](query-dsl-match-query-phrase.md) can also be used if the last term should be matched exactly, and not as a prefix. Using phrase queries may be less efficient than using the `match_bool_prefix` query.
126+
To search for documents that strictly match the query terms in order, or to search using other properties of phrase queries, use a [`match_phrase_prefix` query](/reference/query-languages/query-dsl-match-query-phrase-prefix.md) on the root field. A [`match_phrase` query](/reference/query-languages/query-dsl-match-query-phrase.md) can also be used if the last term should be matched exactly, and not as a prefix. Using phrase queries may be less efficient than using the `match_bool_prefix` query.
127127

128128
```console
129129
GET my-index-000001/_search
@@ -155,8 +155,8 @@ More subfields enables more specific queries but increases index size.
155155

156156
The following parameters are accepted in a mapping for the `search_as_you_type` field due to its nature as a text-like field, and behave similarly to their behavior when configuring a field of the [`text`](text.md) data type. Unless otherwise noted, these options configure the root fields subfields in the same way.
157157

158-
[`analyzer`](analyzer.md)
159-
: The [analyzer](analysis.md) which should be used for `text` fields, both at index-time and at search-time (unless overridden by the [`search_analyzer`](search-analyzer.md)). Defaults to the default index analyzer, or the [`standard` analyzer](analysis-standard-analyzer.md).
158+
[`analyzer`](/reference/elasticsearch/mapping-reference/analyzer.md)
159+
: The [analyzer](docs-content://manage-data/data-store/text-analysis.md) which should be used for `text` fields, both at index-time and at search-time (unless overridden by the [`search_analyzer`](/reference/elasticsearch/mapping-reference/search-analyzer.md)). Defaults to the default index analyzer, or the [`standard` analyzer](/reference/data-analysis/text-analysis/analysis-standard-analyzer.md).
160160

161161
[`index`](mapping-index.md)
162162
: Should the field be searchable? Accepts `true` (default) or `false`.
@@ -185,7 +185,7 @@ The following parameters are accepted in a mapping for the `search_as_you_type`
185185

186186
## Optimization of prefix queries [prefix-queries]
187187

188-
When making a [`prefix`](query-dsl-prefix-query.md) query to the root field or any of its subfields, the query will be rewritten to a [`term`](query-dsl-term-query.md) query on the `._index_prefix` subfield. This matches more efficiently than is typical of `prefix` queries on text fields, as prefixes up to a certain length of each shingle are indexed directly as terms in the `._index_prefix` subfield.
188+
When making a [`prefix`](/reference/query-languages/query-dsl-prefix-query.md) query to the root field or any of its subfields, the query will be rewritten to a [`term`](/reference/query-languages/query-dsl-term-query.md) query on the `._index_prefix` subfield. This matches more efficiently than is typical of `prefix` queries on text fields, as prefixes up to a certain length of each shingle are indexed directly as terms in the `._index_prefix` subfield.
189189

190190
The analyzer of the `._index_prefix` subfield slightly modifies the shingle-building behavior to also index prefixes of the terms at the end of the field’s value that normally would not be produced as shingles. For example, if the value `quick brown fox` is indexed into a `search_as_you_type` field with `max_shingle_size` of 3, prefixes for `brown fox` and `fox` are also indexed into the `._index_prefix` subfield even though they do not appear as terms in the `._3gram` subfield. This allows for completion of all the terms in the field’s input.
191191

0 commit comments

Comments
 (0)