Query_string vs group match in elasticsearch

What is the difference between such a request:

"query": {
"bool": {
 ...
  "should": [
    {
      "match": {
        "description": {
          "query": "test"              
        }
      }
    },
    {
      "match": {
        "address": {
          "query": "test",              
        }
      }
    },
    {
      "match": {
        "country": {
          "query": "test"              
        }
      }
    },
    {
      "match": {
        "city": {
          "query": "test"
        }
      }
    }        
  ]
}}

and that one:

"query": {
"bool": {
 ...      
  "should": [        
    {
      "query_string": {
        "query": "test",
        "fields": [
          "description",
          "address",
          "country",
          "city"              
        ]
      }
    }
  ]
}}

Performance, relevance?

Thanks in advance!

+4
source share
2 answers

The query is analyzed depending on the field analyzer (if you do not specify the analyzer in the query itself), therefore, querying several fields with one query does not necessarily mean analyzing the query only once.

, query_string lucene: AND OR, , , .., , , . , , , multi_match, , query_string, .

, , , query_string . bool, lucene, query_string "use_dis_max":"true", , dis_max . multi_match. use_dis_max false, bool.

+6

, , , match, - .

, , , .

, , - .

0

All Articles