Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Elasticsearch
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Elasticsearch

Mastering Elasticsearch - Second Edition

By : Marek Rogozinski
4.3 (9)
close
close
Mastering Elasticsearch

Mastering Elasticsearch

4.3 (9)
By: Marek Rogozinski

Overview of this book

This book is for Elasticsearch users who want to extend their knowledge and develop new skills. Prior knowledge of the Query DSL and data indexing is expected.
Table of Contents (11 chapters)
close
close
10
Index

Controlling multimatching


Until Elasticsearch 1.1, we had limited control over the multi_match query. Of course, we had the possibility to specify the fields we want our query to be run against; we could use disjunction max queries (by setting the use_dis_max property to true). Finally, we could inform Elasticsearch about the importance of each field by using boosting. Our example query run against multiple fields could look as follows:

curl -XGET 'localhost:9200/library/_search?pretty' -d '{
 "query" : {
  "multi_match" : {
   "query" : "complete conan doyle",
   "fields" : [ "title^20", "author^10", "characters" ]
  }
 }
}'

A simple query that will match documents having given tokens in any of the mentioned fields. In addition to that required query, the title field is more important than the author field, and finally the characters field.

Of course, we could also use the disjunction max query:

curl -XGET 'localhost:9200/library/_search?pretty' -d '{
 "query" : {
  "multi_match" : {
   "query...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Elasticsearch
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon