Interface ModelObjectsSearch<T extends ModelEntity>
- All Superinterfaces:
Iterable<T>
,IterableWithSize<T>
- All Known Subinterfaces:
ModelObjectsSearchWithTemplates<T>
This interface acts both as the builder for Lucene searches and the iterable of the results.
It can be used like the following: for(WorkItem wi: transaction.workItems().search().query("my query")){...
The iterator never returns null values.
All search parameters, specified by using methods like
query(String)
, are optional.
Special caching is in place (historical-queries-sizes in EHCache) for the object count
that matches historical queries, (where the baseline revision is not null),
so calling only IterableWithSize.size()
in these cases is much faster than iterating over the items.- Since:
- 3.9.0
-
Method Summary
Modifier and TypeMethodDescriptionRevision of the baseline that the search should be executed for.limit
(int limit) The maximum number of items to be returned, -1 for unlimited.offset
(int offset) The number of first items to exclude from the result list.Lucene query.Lucene sort string,null
sorts by relevance.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface com.polarion.alm.shared.api.utils.collections.IterableWithSize
addAllTo, isEmpty, size, toArray, toArrayList
-
Method Details
-
query
Lucene query. Only the last value is used when the method is called more than once. -
sort
Lucene sort string,null
sorts by relevance. Only the last value is used when the method is called more than once. -
baseline
Revision of the baseline that the search should be executed for. Only the last value is used when the method is called more than once. -
limit
The maximum number of items to be returned, -1 for unlimited. Only the last value is used when the method is called more than once. -
offset
The number of first items to exclude from the result list. If the offset exceeds the total number of objects, an empty list is returned. Only the last value is used when the method is called more than once.- Since:
- 3.23.4
-