0

I am new to Elasticsearch. I wonder how to use different queries on different fields in a single query. For example, match query on field 1 and field 2, term query on field 3.

Any info is really appreciated.

Thanks and regards.

1 Answer 1

1

You should take a look at the Elasticsearch Bool Query:

Bool Query

A query that matches documents matching boolean combinations of other queries. The bool query maps to Lucene BooleanQuery. It is built using one or more boolean clauses, each clause with a typed occurrence.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html

And the related Bool Filter:

Bool Filter

A filter that matches documents matching boolean combinations of other queries. Similar in concept to Boolean query, except that the clauses are other filters. Can be placed within queries that accept a filter.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-filter.html

Sign up to request clarification or add additional context in comments.

1 Comment

John, thanks again for pointing me to the right direction. best.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.