-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Mastering Elasticsearch 5.x - Third Edition
By :
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
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" : "complete conan doyle",
"fields" : [ "title", "author", "characters" ],
"type" : "best_fields",
"tie_breaker" : 0.8
}
}
}'
The preceding query would be translated into a query similar to the following...
Change the font size
Change margin width
Change background colour