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: docs/reference/elasticsearch/mapping-reference/text.md
-119Lines changed: 0 additions & 119 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -292,122 +292,3 @@ PUT my-index-000001
292
292
}
293
293
}
294
294
```
295
-
296
-
297
-
## Match-only text field type [match-only-text-field-type]
298
-
299
-
A variant of [`text`](#text-field-type) that trades scoring and efficiency of positional queries for space efficiency. This field effectively stores data the same way as a `text` field that only indexes documents (`index_options: docs`) and disables norms (`norms: false`). Term queries perform as fast if not faster as on `text` fields, however queries that need positions such as the [`match_phrase` query](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) perform slower as they need to look at the `_source` document to verify whether a phrase matches. All queries return constant scores that are equal to 1.0.
300
-
301
-
Analysis is not configurable: text is always analyzed with the [default analyzer](docs-content://manage-data/data-store/text-analysis/specify-an-analyzer.md#specify-index-time-default-analyzer) ([`standard`](/reference/text-analysis/analysis-standard-analyzer.md) by default).
302
-
303
-
[span queries](/reference/query-languages/query-dsl/span-queries.md) are not supported with this field, use [interval queries](/reference/query-languages/query-dsl/query-dsl-intervals-query.md) instead, or the [`text`](#text-field-type) field type if you absolutely need span queries.
304
-
305
-
Other than that, `match_only_text` supports the same queries as `text`. And like `text`, it does not support sorting and has only limited support for aggregations.
306
-
307
-
```console
308
-
PUT logs
309
-
{
310
-
"mappings": {
311
-
"properties": {
312
-
"@timestamp": {
313
-
"type": "date"
314
-
},
315
-
"message": {
316
-
"type": "match_only_text"
317
-
}
318
-
}
319
-
}
320
-
}
321
-
```
322
-
323
-
324
-
### Parameters for match-only text fields [match-only-text-params]
: Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
## Pattern text field type [pattern-text-field-type]
336
-
```{applies_to}
337
-
serverless: preview
338
-
stack: preview 9.2
339
-
```
340
-
:::{note}
341
-
This feature requires a [subscription](https://www.elastic.co/subscriptions).
342
-
:::
343
-
344
-
The `pattern_text` field type is a variant of [`text`](#text-field-type) with improved space efficiency for log data.
345
-
Internally, it decomposes values into static parts that are likely to be shared among many values, and dynamic parts that tend to vary.
346
-
The static parts usually come from the explanatory text of a log message, while the dynamic parts are the variables that were interpolated into the logs.
347
-
This decomposition allows for improved compression on log-like data.
348
-
349
-
We call the static portion of the value the `template`.
350
-
Although the template cannot be accessed directly, a separate field called `<field_name>.template_id` is accessible.
351
-
This field is a hash of the template and can be used to group similar values.
352
-
353
-
Analysis is configurable but defaults to a delimiter-based analyzer.
354
-
This analyzer applies a lowercase filter and then splits on whitespace and the following delimiters: `=`, `?`, `:`, `[`, `]`, `{`, `}`, `"`, `\`, `'`.
355
-
356
-
### Limitations
357
-
358
-
Unlike most mapping types, `pattern_text` does not support multiple values for a given field per document.
359
-
If a document is created with multiple values for a pattern_text field, an error will be returned.
360
-
361
-
[span queries](/reference/query-languages/query-dsl/span-queries.md) are not supported with this field, use [interval queries](/reference/query-languages/query-dsl/query-dsl-intervals-query.md) instead, or the [`text`](#text-field-type) field type if you absolutely need span queries.
362
-
363
-
Like `text`, `pattern_text` does not support sorting and has only limited support for aggregations.
364
-
365
-
### Phrase matching
366
-
Pattern text supports an `index_options` parameter with valid values of `docs` and `positions`.
367
-
The default value is `docs`, which makes `pattern_text` behave similarly to `match_only_text` for phrase queries.
368
-
Specifically, positions are not stored, which reduces the index size at the cost of slowing down phrase queries.
369
-
If `index_options` is set to `positions`, positions are stored and `pattern_text` will support fast phrase queries.
370
-
In both cases, all queries return a constant score of 1.0.
371
-
372
-
### Index sorting for improved compression
373
-
The compression provided by `pattern_text` can be significantly improved if the index is sorted by the `template_id` field.
374
-
For example, a typical approach would be to sort first by `message.template_id`, then by `@timestamp`, as shown in the following example.
: The [analyzer](docs-content://manage-data/data-store/text-analysis.md) which should be used for the `pattern_text` field, both at index-time and at search-time (unless overridden by the [`search_analyzer`](/reference/elasticsearch/mapping-reference/search-analyzer.md)).
405
-
Supports a delimiter-based analyzer and the standard analyzer, as is used in `match_only_text` mappings.
406
-
Defaults to the delimiter-based analyzer, which applies a lowercase filter and then splits on whitespace and the following delimiters: `=`, `?`, `:`, `[`, `]`, `{`, `}`, `"`, `\`, `'`.
0 commit comments