ElasticSearch中具有匹配项序列的模糊搜索

时间:2019-03-14 07:03:52

标签: elasticsearch full-text-search fuzzy-search

我是ElasticSearch的初学者。 我正在尝试创建将处理较小的拼写错误并显示结果的搜索。为此,我在匹配查询中使用了模糊性,如下所示。

{
"query": {
    "match": {
        "CompanyName": {
            "query": "CBL Da",
            "fuzziness": "AUTO",
            "prefix_length":3,
            "max_expansions":50,
            "fuzzy_transpositions" :false

        }
    }
  }
}

我的问题是查询生成的结果不相关。它就是这样产生的:

Cbl industries limited
CBL INVESTMENTS LTD
Cbl travels private limited
Cbl enterprises (india) private limited
CBL DATA SCIENCE PRIVATE LIMITED
CBL GLOBAL INDUSTRIES PRIVATE LIMITED
CBL Trading Concepts Private Limited
D.a. finvest limited
CBL DATA RECOVERY TECHNOLOGIES PRIVATE LIMITED
Da infraworld private limited

根据我的要求,它应产生如下结果:

CBL DATA SCIENCE PRIVATE LIMITED
CBL DATA RECOVERY TECHNOLOGIES PRIVATE LIMITED
Cbl industries limited
CBL INVESTMENTS LTD
Cbl travels private limited
Cbl enterprises (india) private limited
CBL GLOBAL INDUSTRIES PRIVATE LIMITED
CBL Trading Concepts Private Limited
D.a. finvest limited
Da infraworld private limited

我也曾用令牌生成器和分析器进行过尝试。

"edge_ngram_filter": {
               "type": "edge_ngram",
               "min_gram": 2,
               "max_gram": 20
            }

"analyzer": {
            "edge_ngram_analyzer": {
               "type": "custom",
               "tokenizer": "standard",
               "filter": [
                  "lowercase",
                  "edge_ngram_filter"
               ]
            }
         }

请帮助我解决此问题。

Query Result

0 个答案:

没有答案