@InterfaceStability.Experimental @InterfaceAudience.Public public interface SearchQueryResult extends Iterable<SearchQueryRow>
The main interface for FTS query results. It is also an Iterable<SearchQueryRow>, where iteration is similar to iterating over hitsOrFail().
| Modifier and Type | Method and Description |
|---|---|
List<String> |
errors()
When an execution error happens (including partial results), this method returns a
List of the error(s) in JSON format. |
Map<String,FacetResult> |
facets()
If one or more facet were requested via the
SearchQuery#addFacets(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). |
SearchMetrics |
metrics()
Provides a
SearchMetrics object giving statistics on the request like number of hits, total time taken… |
SearchStatus |
status()
The
SearchStatus allows to check if the request was a full success (SearchStatus.isSuccess()) and gives more details about status for each queried index. |
forEach, spliteratorSearchStatus status()
The SearchStatus allows to check if the request was a full success (SearchStatus.isSuccess()) and gives more details about status for each queried index.
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.
List<SearchQueryRow> hitsOrFail()
The list of FTS result rows, or “hits”, for the FTS query. In case of an execution error (eg. partial results), a CompositeException is thrown instead.
List<String> errors()
When an execution error happens (including partial results), this method returns a List of the error(s) in JSON format.
Map<String,FacetResult> facets()
If one or more facet were requested via the SearchQuery#addFacets(SearchFacet...) method when querying, contains the result of each facet. The map keys are the names given to each requested facet.
SearchMetrics metrics()
Provides a SearchMetrics object giving statistics on the request like number of hits, total time taken…
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 over hitsOrFail()).
iterator in interface Iterable<SearchQueryRow>Copyright © 2015 Couchbase, Inc.