Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/reference/elasticsearch/mapping-reference/pattern-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,18 @@ In both cases, all queries return a constant score of 1.0.

## Index sorting for improved compression
The compression provided by `pattern_text` can be significantly improved if the index is sorted by the `template_id` field.
This sorting is not applied by default, but can be enabled for the `message` field of LogsDB indices (assuming it is of type `pattern_text`) by setting the index setting `index.logsdb.default_sort_on_message_template` to `true`.


### Default sorting for LogsDB
```{applies_to}
serverless: preview
stack: preview 9.3
```
This index sorting is not applied by default, but can be enabled for the `message` field of LogsDB indices (assuming it is of type `pattern_text`) by setting the index setting `index.logsdb.default_sort_on_message_template` to `true`.
This will cause the index to be sorted by `host.name` (if present), then `message.template_id`, and finally by `@timestamp`.


### Custom sorting
If the index is not LogsDB or the `pattern_text` field is named something other than `message`, index sorting can still be manually applied as shown in the following example.

```console
Expand All @@ -73,6 +83,7 @@ PUT logs
```



## Parameters for pattern text fields [pattern-text-params]

The following mapping parameters are accepted:
Expand Down