我正在尝试构建您的意思是不是指Elasticsearch的功能,建议者提出建议,但点击返回为空。
这是我的设置的一部分:
'settings' : {
"analysis" : {
'filter' : {
'shingle' : {
'type' : 'shingle',
'min_shingle_size' : '2',
'max_shingle_size' : '3'
}
},
'analyzer' : {
'trigram' : {
'type' : 'custom',
'tokenizer' : 'standard',
'filter' : {
'lowercase',
'shingle'
}
}
}
}
}
和我的映射部分:
'properties' : {
'product_name' : {
'type' : 'keyword',
'fields' : {
'suggestion' : {
'type' : 'text',
'analyzer' : 'trigram',
}
}
}
和我的查询:
'suggest' : {
'text' : 'hair colur',
'suggestion' : {
'phrase' : {
'field' : 'product_name.suggestion',
'size' : '1',
'gram_size' : '3',
"max_errors" : 0.5,
"confidence" : 0,
'direct_generator' : {
{
'field' : 'product_name.suggestion',
'suggest_mode' : 'always'
}
},
'collate' : {
"prune" : "true",
'query' : {
'source' : {
'multi_match' : {
'query' : "{{suggestion}}",
'fields' : {
'product_name.analyzed',
'brand.analyzed'
},
'fuzziness' : 1,
'type' : 'best_fields',
'operator' : 'AND'
}
}
}
}
}
}
{s:10:“建议”; a:1:{i:0; a:4:{s:4:“文本”; s:12:“ 头发颜色”; s:6:“ offset”; i:0; s:6:“ length”; i:10; s:7:“ options”; a:1:{i:0; a:4:{s:4: “ text”; s:12:“ 头发颜色”; s:11:“突出显示”; s:21:“头发 颜色 ” ; s:5:“得分”; d:0.103021406; s:13:“ collate_match”; b:1;}}}}}}
建议它可以正常工作,但没有成功,我该如何工作?如果有建议,则用建议填充点击量