ElasticSearch - cross_fields multi match with fuzzy search

前端 未结 2 1809
名媛妹妹
名媛妹妹 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 :)

提交回复
热议问题