public class SearchResult<T> extends Object
Response
containing the response to an Elasticsearch search request.
It's what is returned by search requests like on RecordmActionPack
or UsermActionPack
.
It's very similar to a ReusableResponse
.
Constructor and Description |
---|
SearchResult(javax.ws.rs.core.Response response,
Function<Map<String,Object>,T> hitBuilder) |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getBody()
Returns the body of the
Response as a Map . |
String |
getBodyAsString()
Returns a string representation of the response body.
|
List<T> |
getHits()
Returns the results included in this response to the search.
|
int |
getStatus()
Returns the HTTP status of the underlying
Response |
int |
getTotal()
Returns the total number of results for the search.
|
boolean |
ok()
Returns true if the status of the underlying
Response is a 2xx. |
boolean |
success()
Returns true if the status of the underlying
Response is a 2xx. |
public String getBodyAsString()
public List<T> getHits()
size
parameter sent in the search request.List
of instances of <T> one for each resultpublic int getStatus()
Response
public int getTotal()
public boolean ok()
Response
is a 2xx.public boolean success()
Response
is a 2xx.Copyright © 2021 Cult Of Bits, lda