Querying multiple fields with defaults

We want to provide a product search functionality in our web application. When the end user searches for some terms, we want to query both the title and description fields. This can be done using the multi_match query.

The following query will find all of the documents that have the terms monitor or aquarium in the title or the description fields:

GET /amazon_products/_search
{
"query": {
"multi_match": {
"query": "monitor aquarium",
"fields": ["title", "description"]
}
}
}

This query gives equal importance to both fields. Let's look at how to boost one or more fields.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset