elasticsearch match all words from document in the search query

后端 未结 2 1965
-上瘾入骨i
-上瘾入骨i 2020-12-15 08:25

We can search for ALL words in a specific document.field like this:

{ \"query\" : { \"match\" : { \"title\": { \"query\" : \"Black Nike Mens\", \"operator\"          


        
2条回答
  •  心在旅途
    2020-12-15 09:02

    The Percolate query should help here. You'd register your documents as queries, making "Nike Free Sparq Mens White" a match query with an AND operator.

    Then your query can become a document like one having "Nike Free Sparq 09 - Mens - White/Black/Varsity Red" as content. You should get "Nike Free Sparq Mens White" back, because it matches all terms.

    Unfortunately, this won't scale well (e.g. if you have millions of documents, it might get slow).

提交回复
热议问题