06-01-2015, 08:31 PM
DSL edit query
elasticsearch offers a complete query DSL based on JSON to define queries. In general, there are basic queries, such as prefix or term. There are also compound queries like query, bool. Queries can also have filters associated with them, such as constant_score, or filtered queries with specific questions of filtering.
Consider the Query DSL as AST queries. Some queries may also contain other questions (such as query, bool), others may contain filters (such as constant_score), and some may contain both a query or a filter (such as filtered). Each of these can contain any query to the query or filter list from the list of filters, resulting in the ability to build queries quite complex (and interesting).
Both queries and filters can be used in different APIs. For example, in a search query, or as a skin maker. This section explains the components (queries and filters) that can form the AST can be used.
Filters are very useful because they make an order of magnitude better than the simple questions, because scoring is achieved and are cached automatically.