public class NestedQuery extends Object
Nested queries must be used along with nested lists. Otherwise,
if there are several objects nested in a list, an entity would also match, if the filtered properties match
against any of the nested objects instead of all in a single one - which is most commonly wanted.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-nested-query.html
| Modifier | Constructor and Description |
|---|---|
protected |
NestedQuery(Mapping path)
Creates a new nested query for elements in the given field / list.
|
| Modifier and Type | Method and Description |
|---|---|
ElasticConstraint |
build()
Compiles the query into a constraint.
|
NestedQuery |
eq(Mapping field,
Object value)
Adds a simple
FilterFactory.eq(Mapping, Object) filter as inner filter. |
NestedQuery |
where(ElasticConstraint constraint)
Appends an inner constraint.
|
protected NestedQuery(Mapping path)
path - the name of the list to search in.public NestedQuery where(ElasticConstraint constraint)
Note that all fields must be fully qualified (e.g. list.valueX instead of simly valueX).
constraint - the filter to addpublic NestedQuery eq(Mapping field, Object value)
FilterFactory.eq(Mapping, Object) filter as inner filter.field - the fully qualified field to filter onvalue - the value to filter onpublic ElasticConstraint build()
Copyright © 2018. All rights reserved.