@InterfaceStability.Committed @InterfaceAudience.Public public class DefaultAsyncSearchQueryResult extends Object implements AsyncSearchQueryResult
AsyncSearchQueryResult
Constructor and Description |
---|
DefaultAsyncSearchQueryResult(SearchStatus status,
rx.Observable<SearchQueryRow> hits,
rx.Observable<FacetResult> facets,
rx.Observable<SearchMetrics> metrics) |
Modifier and Type | Method and Description |
---|---|
rx.Observable<FacetResult> |
facets()
An
Observable emitting a FacetResult for each requested facet in the original request. |
static AsyncSearchQueryResult |
fromHttp400(String payload)
Deprecated.
FTS is still in BETA so the response format is likely to change in a future version, and be
unified with the HTTP 200 response format.
|
static AsyncSearchQueryResult |
fromHttp412()
Deprecated.
FTS is still in BETA so the response format is likely to change in a future version, and be
unified with the HTTP 200 response format.
|
static AsyncSearchQueryResult |
fromHttp429(String payload)
Creates a result out of the http 429 response code if retry didn't work.
|
static AsyncSearchQueryResult |
fromIndexNotFound(String indexName)
Deprecated.
FTS is still in BETA so the response format is likely to change in a future version, and be
unified with the HTTP 200 response format.
|
static AsyncSearchQueryResult |
fromJson(JsonObject json)
Deprecated.
FTS is still in BETA so the response format is likely to change in a future version
|
rx.Observable<SearchQueryRow> |
hits()
An
Observable of rows (or hits) describing each individual result. |
rx.Observable<SearchMetrics> |
metrics()
An
Observable asynchronously providing statistics about the request in the form of a single
SearchMetrics . |
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. |
public DefaultAsyncSearchQueryResult(SearchStatus status, rx.Observable<SearchQueryRow> hits, rx.Observable<FacetResult> facets, rx.Observable<SearchMetrics> metrics)
public SearchStatus status()
AsyncSearchQueryResult
SearchStatus
allows to check if the request was a full success (SearchStatus.isSuccess()
)
and gives more details about status for each queried index.status
in interface AsyncSearchQueryResult
public rx.Observable<SearchQueryRow> hits()
AsyncSearchQueryResult
Observable
of rows
(or hits) describing each individual result. Note that
in case of a partial success, Observer.onError(Throwable)
will be called after each partial
result has been emitted. In case of a full execution failure, no hit is emitted before the onError.
The following execution-level exceptions can happen:
- if there is one or more execution-level errors, each of them is represented as a RuntimeException
,
and all are aggregated into a single CompositeException
.
- if the request is malformed, the server side error message is returned as the message of a CouchbaseException
.hits
in interface AsyncSearchQueryResult
public rx.Observable<FacetResult> facets()
AsyncSearchQueryResult
Observable
emitting a FacetResult
for each requested facet in the original request.facets
in interface AsyncSearchQueryResult
public rx.Observable<SearchMetrics> metrics()
AsyncSearchQueryResult
Observable
asynchronously providing statistics about the request in the form of a single
SearchMetrics
. Note that the metrics are emitted after all hits have been received.metrics
in interface AsyncSearchQueryResult
@Deprecated public static AsyncSearchQueryResult fromJson(JsonObject json)
AsyncSearchQueryResult
from a JSON representation of the
whole search service response.json
- the whole response, as returned by the search service.AsyncSearchQueryResult
.@Deprecated public static AsyncSearchQueryResult fromHttp400(String payload)
AsyncSearchQueryResult
. HTTP 400 indicates the request was malformed and couldn't
be parsed on the server. As of Couchbase Server 4.5 such a response is a text/plain
body that describes the parsing error. The whole body is emitted/thrown, wrapped in a
FtsMalformedRequestException
.payload
- the HTTP 400 response body describing the parsing failure.AsyncSearchQueryResult
that will emit a FtsMalformedRequestException
when calling its
hits()
method.@Deprecated public static AsyncSearchQueryResult fromHttp412()
AsyncSearchQueryResult
. HTTP 412 indicates the request couldn't be satisfied with given
consistency before the timeout expired. This is translated to a FtsConsistencyTimeoutException
.AsyncSearchQueryResult
that will emit a FtsConsistencyTimeoutException
when calling
its hits()
method.public static AsyncSearchQueryResult fromHttp429(String payload)
@Deprecated public static AsyncSearchQueryResult fromIndexNotFound(String indexName)
AsyncSearchQueryResult
that will emit a IndexDoesNotExistException
when calling
its hits()
method.Copyright © 2015 Couchbase, Inc.