Interface SearchQueryResult
-
- All Superinterfaces:
Iterable<SearchQueryRow>
- All Known Implementing Classes:
DefaultSearchQueryResult
@Committed @Public public interface SearchQueryResult extends Iterable<SearchQueryRow>
The main interface for FTS query results. It is also anIterable<SearchQueryRow>, where iteration is similar to iterating overhitsOrFail().- Since:
- 2.3.0
- Author:
- Simon Baslé, Michael Nitschinger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>errors()When an execution error happens (including partial results), this method returns aListof the error(s) inJSON format.Map<String,FacetResult>facets()If one or more facet were requested via theSearchQuery.addFacet(String, SearchFacet)method when querying, contains the result of each facet.List<SearchQueryRow>hits()The list of FTS result rows, or "hits", for the FTS query.List<SearchQueryRow>hitsOrFail()The list of FTS result rows, or "hits", for the FTS query.Iterator<SearchQueryRow>iterator()Returns an iterator over the hits (SearchQueryRow).SearchMetricsmetrics()Provides aSearchMetricsobject giving statistics on the request like number of hits, total time taken...SearchStatusstatus()TheSearchStatusallows to check if the request was a full success (SearchStatus.isSuccess()) and gives more details about status for each queried index.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
status
SearchStatus status()
TheSearchStatusallows to check if the request was a full success (SearchStatus.isSuccess()) and gives more details about status for each queried index.
-
hits
List<SearchQueryRow> hits()
The list of FTS result rows, or "hits", for the FTS query. This method always returns a list, including when an execution error (eg. partial results) occurred.
-
hitsOrFail
List<SearchQueryRow> hitsOrFail()
The list of FTS result rows, or "hits", for the FTS query. In case of an execution error (eg. partial results), aCompositeExceptionis thrown instead.
-
errors
List<String> errors()
When an execution error happens (including partial results), this method returns aListof the error(s) inJSON format.
-
facets
Map<String,FacetResult> facets()
If one or more facet were requested via theSearchQuery.addFacet(String, SearchFacet)method when querying, contains the result of each facet.The map keys are the names given to each requested facet.
-
metrics
SearchMetrics metrics()
Provides aSearchMetricsobject giving statistics on the request like number of hits, total time taken...
-
iterator
Iterator<SearchQueryRow> iterator()
Returns an iterator over the hits (SearchQueryRow). If an execution error happened, the corresponding exception is thrown instead (same as attempting to iterate overhitsOrFail()).- Specified by:
iteratorin interfaceIterable<SearchQueryRow>- Returns:
- an Iterator of rows/hits.
-
-