T
- public interface Query<T> extends FieldOrSubFilter<T>, OrderBy<T>, Limit<T>
Search for business data values using different filters for text, number and date fields. The result can be ordered and limited.
Example:
import workflow.business.data.Dossier;
List<Dossier> result = ivy.repo.search(Dossier.class)
.textField("person.firstName").containsWordPattern("A*")
.orderBy().field("person.lastName").descending()
.limit(10)
.execute()
.getAll();
The method Query.score()
allows to build Google like searches. The returned result hits are by default ordered by score (best fit first).
Note, some result may not match the complete query string but may also be relevant.
Example:
This will return all dossiers that contain the words
import workflow.business.data.Dossier;
List<Dossier> result = ivy.repo.search(Dossier.class)
.score().allTextFields().query("Axon+Ivy~1")
.limit(50)
.execute()
.getAll();
Axon
and Ivy
but also dossiers where Ivy
is not spelled correct (e.g. Ivi
, Ify
, etc).
Filters and score can be combined.
Modifier and Type | Method and Description |
---|---|
Result<T> |
raw(String rawSearchQuery)
Search for business data values using a raw Elasticsearch search query.
|
allFields, dateTimeField, filter, not, numberField, textField, textFields
Result<T> raw(String rawSearchQuery)
Search for business data values using a raw Elasticsearch search query.
Warning: The format of the raw search query string may change in future versions.
Only use this method if you have to use a feature that is not support by the other query
methods.
Example:
import workflow.business.data.Dossier;
List<Dossier> result = ivy.repo.search(Dossier.class).raw(
"{\"size\":10,\"sort\":[{\"person.lastName\":\"desc\"}],\"query\":{\"bool\":{\"filter\":[{\"wildcard\":{\"person.firstName\":\"a*\"}}]}},\"_source\":{\"exclude\":[\"*\"]}}")
.getAll();
rawSearchQuery
- the raw elastic search query as jsonFieldOrSubFilter.allFields()
,
FieldOrSubFilter.textField(String)
,
FieldOrSubFilter.dateTimeField(String)
,
FieldOrSubFilter.numberField(String)
Copyright © 2024
AXON IVY AG
All Rights Reserved Documentation was generated
on April 28, 2024