-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve docs for index_prefixes option (#35778)
This commit moves the documentation and examples for the `index_prefixes` option on text fields to its own file, to bring it in line with other mapping parameters, and expands a bit on both.
- Loading branch information
1 parent
2887680
commit be8097f
Showing
5 changed files
with
69 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[[index-prefixes]] | ||
=== `index_prefixes` | ||
|
||
The `index_prefixes` parameter enables the indexing of term prefixes to speed | ||
up prefix searches. It accepts the following optional settings: | ||
|
||
[horizontal] | ||
`min_chars`:: | ||
|
||
The minimum prefix length to index. Must be greater than 0, and defaults | ||
to 2. The value is inclusive. | ||
|
||
`max_chars`:: | ||
|
||
The maximum prefix length to index. Must be less than 20, and defaults to 5. | ||
The value is inclusive. | ||
|
||
This example creates a text field using the default prefix length settings: | ||
|
||
[source,js] | ||
-------------------------------- | ||
PUT my_index | ||
{ | ||
"mappings": { | ||
"_doc": { | ||
"properties": { | ||
"body_text": { | ||
"type": "text", | ||
"index_prefixes": { } <1> | ||
} | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------- | ||
// CONSOLE | ||
|
||
<1> An empty settings object will use the default `min_chars` and `max_chars` | ||
settings | ||
|
||
This example uses custom prefix length settings: | ||
|
||
[source,js] | ||
-------------------------------- | ||
PUT my_index | ||
{ | ||
"mappings": { | ||
"_doc": { | ||
"properties": { | ||
"full_name": { | ||
"type": "text", | ||
"index_prefixes": { | ||
"min_chars" : 1, | ||
"max_chars" : 10 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------- | ||
// CONSOLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters