原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/index-prefixes.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/index-prefixes.html
本地英文版地址: ../en/index-prefixes.html
重要: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 当前版本文档。
index_prefixes
edit
The index_prefixes
parameter enables the indexing of term prefixes to speed
up prefix searches. It accepts the following optional settings:
|
The minimum prefix length to index. Must be greater than 0, and defaults to 2. The value is inclusive. |
|
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:
PUT my_index { "mappings": { "properties": { "body_text": { "type": "text", "index_prefixes": { } } } } }
This example uses custom prefix length settings:
PUT my_index { "mappings": { "properties": { "full_name": { "type": "text", "index_prefixes": { "min_chars" : 1, "max_chars" : 10 } } } } }