O'Reilly logo

Mastering Elasticsearch 5.x - Third Edition by Bharvi Dixit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Multimatch types

In this section, we will cover the different flavors of multi-match queries, which are mainly controlled using the type property. The following are the available types:

  • The best_fields type
  • The most_fields type
  • The cross_fields type
  • The phrase type
  • The phrase_prefix type

Best fields matching

To use the best_fields type matching, one needs to set the type property of the multi_match query to the best_fields query. This type of multimatching will generate a match query for each field specified in the fields property and it is best used for searching for multiple words in the same best matching field. For example, let's look at the following query:

curl -XGET 'localhost:9200/library/_search?pretty' -d '{ "query" : { "multi_match" : { "query" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required