[ES from entry to actual combat] eleven, full-text search-ElasticSearch-advanced-match full-text search

Continue to section 10

3), match【match query】

  • Basic type (non-string), exact match

match returns data with account_number=20:

GET /bank/_search
{
    
    
  "query": {
    
    
    "match": {
    
    
      "account_number": 20
    }
  }
}

Insert picture description here

  • String, full text search

Finally, all records containing the word Kings in the address are searched out. When searching for the string type, a full-text search will be performed, and each record has a relevance score.

GET /bank/_search
{
    
    
  "query": {
    
    
    "match": {
    
    
      "address": "Kings"
    }
  }
}

Insert picture description here

  • String, multiple words (word segmentation + full text search)

Full text search is sorted according to the score, and the search conditions will be segmented and matched

GET /bank/_search
{
    
    
  "query": {
    
    
    "match": {
    
    
      "address": "Mill Lane"
    }
  }
}

Finally, query all the records that contain Mill or Lane or Mill Lane in the address, and give the relevance score
Insert picture description here

Reference document-query-dsl


reference:

Elasticsearch Reference

elastic

Getting started with the full-text search engine Elasticsearch

Guess you like

Origin blog.csdn.net/runewbie/article/details/106342547