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