MongoDB Atlas搜索自动完成索引错误评分

MongoDB Atlas搜索自动完成索引错误评分,mongodb,lucene,mongodb-atlas,full-text-indexing,mongodb-atlas-search,Mongodb,Lucene,Mongodb Atlas,Full Text Indexing,Mongodb Atlas Search,我有一个MongoDB Atlas搜索索引,在字段名上具有自动完成类型和以下属性: maxGrams : 15 minGrams : 2 tokenization: edgeGram fold diacritics: true 集合包含以下名称: The American The American Equity Underwriters The American Prairie Foundation The American Conservatory Theater The American

我有一个MongoDB Atlas搜索索引,在字段名上具有自动完成类型和以下属性:

maxGrams : 15
minGrams : 2
tokenization: edgeGram
fold diacritics: true
集合包含以下名称:

The American
The American Equity Underwriters
The American Prairie Foundation
The American Conservatory Theater
The American Club
使用此自动完成查询:

{
  autocomplete: {
    query: 'The American',
    path: 'name'
  }
}
我可以通过以下searchScore检索上述所有姓名:

The American Conservatory Theater -> 15.474836349487305
The American Equity Underwriters -> 15.379003524780273
The American Prairie Foundation -> 15.379003524780273
The American Club -> 15.271049499511719
The American -> 13.68109130859375
即使美国队是一场精确的比赛,它的得分也较低


为什么确切的匹配搜索分数低于其他分数?

作为一种解决方法,我发现了如下内容:

{
  "compound": { 
    "should": [
      {
      "phrase": {
        "query": "The American", 
        "path": "name", 
        "score": { "boost": {"value": 5}}
      }},
    {
      "autocomplete": { 
        "query": "The American",
        "path": "name"}
    }
    ]
  }
}

短语匹配中的分数提升将处理精确匹配,使精确匹配分数高于其他匹配项。

你能增加<代码> MimgG/<代码>和< <代码> > Max?< /代码>?不会修复我的问题,到目前为止这是不可扩展的。请考虑这样大的宽度非常昂贵。你的索引定义是什么样子的?您是否有一个多分析器,其中名称使用关键字和自动完成进行索引?是的,名称使用“字符串”和“自动完成”数据类型进行索引。