我正在将Elasticsearch实例从1.7升级到5.4.3,并注意到两个系统之间的搜索结果不同,即使使用相同的查询。
{
"query": {
"filtered": {
"query": {
"multi_match": {
"query": "something",
"fields": [
"field1",
"field2",
"field3"
],
"operator": "and"
}
}
}
}
}
Elasticsearch 5.4查询
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "something",
"fields": [
"field1",
"field2",
"field3"
],
"operator": "and"
}
}
]
}
}
}
_explain
最终,我发现评分方式有所不同。此外,此查询包括搜索查询匹配的同义词。
{
"_index": "...",
"_type": "...",
"_id": "...",
"matched": true,
"explanation": {
"value": 9.963562,
"description": "max of:",
"details": [
{
"value": 3.1413355,
"description": "sum of:",
"details": [
{
"value": 1.0609967,
"description": "weight(field1:something in 13) [PerFieldSimilarity], result of:",
"details": [
...remainder removed for brevity
解释Elasticsearch 5.4
{
"_index": "...",
"_type": "...",
"_id": "...",
"matched": true,
"explanation": {
"value": 7.1987557,
"description": "sum of:",
"details": [
{
"value": 7.1987557,
"description": "max of:",
"details": [
{
"value": 6.659632,
"description": "weight(Synonym(field1:something field1:something2 field1:something3) in 113) [PerFieldSimilarity], result of:",
"details": [
...remainder removed for brevity
问题
-
-
事实上
Elasticsearch 1.7显示的查询
max of
sum of
对于计算,它是
对面的
对于Elasticsearch 5.4,指出部分问题?