Elasticsearch how to use multi_match with wildcard

后端 未结 5 848
再見小時候
再見小時候 2020-12-13 03:55

I have a User object with properties Name and Surname. I want to search these fields using one query, and I found multi_match in the documentation, but I don\'t

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 04:27

    I would not use wildcards, it will not scale well. You are asking a lot of the search engine at query time. You can use the nGram filter, to do the processing at index-time not search time.

    See this discussion on the nGram filter.

    After indexing the name and surname correctly (change your mapping, there are examples in the above link) you can use multi-match but without wildcards and get the expected results.

提交回复
热议问题