Queries are
just like filters, queries should be used instead of filters:
a.
For
full text search
b.
Where
the result depends on a relevance score
Use query
clauses for full-text search or for any condition that should affect the
relevance score, and use filter clauses for everything else.
Elasticsearch
provides QueryBuilders API to build a query. Once your query is ready, you can
use the Search API.
Following
classes are used to builde query/filter.
import
static org.elasticsearch.index.query.QueryBuilders.*;
import
static org.elasticsearch.index.query.FilterBuilders.*;
No comments:
Post a Comment