ElasticSearch - cross_fields multi match with fuzzy search

前端 未结 2 1803
名媛妹妹
名媛妹妹 2021-02-02 12:47

I have documents that represent users. They have fields name and surname.

Let\'s say I have two users indexed - Michael Jackson and Michael Sta

相关标签:
2条回答
  • 2021-02-02 12:59

    Jack Mich type of searches

    • Make sure when you are querying use OR and not AND e.g. Jack OR Mich
    • Also essentially you want to do a partial matching on the fields. For this you need to enable nGrams on these fields (do this in mapping) so that index have matches for partial words

    You are using the correct query type. These two should solve your problems.

    PS: We all are learning here, doing that together is fun :)

    0 讨论(0)
  • 2021-02-02 12:59

    To answer your second problem:

    It cannot be set to fuzzy search. I really need the fuzzy search but keep the quality of multi_match with cross_fields type.

    The cross_fields query does not support fuzzy searching. See the issue on GitHub:

    https://github.com/elasticsearch/elasticsearch/issues/6866

    0 讨论(0)
提交回复
热议问题