0
我的部分映射和查询部分映射工作的伟大,例如术语乔恩·多伊打破了其任期载体..ElasticSearch与空间
"terms": {
"j": {
"term_freq": 1
},
"jo": {
"term_freq": 1
},
"jon": {
"term_freq": 1
},
"d": {
"term_freq": 1
},
"do": {
"term_freq": 1
},
"doe": {
"term_freq": 1
}
}
但我想它是。 。
"terms": {
"j": {
"term_freq": 1
},
"jo": {
"term_freq": 1
},
"jon": {
"term_freq": 1
},
"jon ": {
"term_freq": 1
},
"jon d": {
"term_freq": 1
},
"jon do": {
"term_freq": 1
},
"jon doe": {
"term_freq": 1
}
}
这里是我的映射和设置:
映射:
name: {
type: 'string',
term_vector: 'yes',
analyzer: 'ngram_analyzer',
search_analyzer: 'standard',
include_in_all: true
}
个
设置:
settings: {
index: {
analysis: {
filter: {
ngram_filter: {
type: 'edge_ngram',
min_gram: 1,
max_gram: 15
}
},
analyzer: {
'ngram_analyzer': {
filter: [
'lowercase',
'ngram_filter'
],
type: 'custom',
tokenizer: 'standard'
}
}
},
number_of_shards: 1,
number_of_replicas: 1
}
}
};
我会如何呢?
按预期工作!谢谢 – emarel
stefen这个方法有一个副作用,当你在_all上搜索时,没有找到关键词标记符的匹配项。为什么是这样? – emarel