原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/position-increment-gap.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/position-increment-gap.html
本地英文版地址: ../en/position-increment-gap.html
重要: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 当前版本文档。
position_increment_gapedit
Analyzed text fields take term positions
into account, in order to be able to support
proximity or phrase queries.
When indexing text fields with multiple values a "fake" gap is added between
the values to prevent most phrase queries from matching across the values. The
size of this gap is configured using position_increment_gap and defaults to
100.
For example:
PUT my_index/_doc/1
{
"names": [ "John Abraham", "Lincoln Smith"]
}
GET my_index/_search
{
"query": {
"match_phrase": {
"names": {
"query": "Abraham Lincoln"
}
}
}
}
GET my_index/_search
{
"query": {
"match_phrase": {
"names": {
"query": "Abraham Lincoln",
"slop": 101
}
}
}
}
|
This phrase query doesn’t match our document which is totally expected. |
|
|
This phrase query matches our document, even though |
The position_increment_gap can be specified in the mapping. For instance: