public class ElasticsearchResultConverter extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ElasticsearchResultConverter.ResultMapper<T>
The result mapper is used to map a hit returned by an Elasticsearch query into a response object.
|
Modifier and Type | Field and Description |
---|---|
static String |
NESTED_RESULT_NODE_NAME |
static String |
RESULT_CONTENT_NODE_NAME |
static String |
RESULT_CONTENT_SCORE_NODE_NAME |
static String |
RESULT_CONTENT_SOURCE_NODE_NAME |
static String |
RESULT_NODE_NAME |
static String |
TOTAL_COUNT_NODE_NAME |
Modifier and Type | Method and Description |
---|---|
protected static <T> List<T> |
convertHits(com.fasterxml.jackson.databind.JsonNode hitsRoot,
ElasticsearchResultConverter.ResultMapper<T> resultMapper) |
static <T> Page<T> |
convertSearchResult(com.fasterxml.jackson.databind.JsonNode searchResult,
ElasticsearchResultConverter.ResultMapper<T> resultMapper,
int start,
int size) |
static <T> List<T> |
convertSearchResultToList(com.fasterxml.jackson.databind.JsonNode searchResult,
ElasticsearchResultConverter.ResultMapper<T> resultMapper) |
static Optional<com.fasterxml.jackson.databind.JsonNode> |
extractFirstContentSourceFromHits(com.fasterxml.jackson.databind.JsonNode resultNode) |
static Optional<com.fasterxml.jackson.databind.node.ArrayNode> |
extractHits(com.fasterxml.jackson.databind.JsonNode resultNode) |
static long |
getHitsTotalCount(com.fasterxml.jackson.databind.JsonNode hitsRoot) |
public static final String RESULT_NODE_NAME
public static final String RESULT_CONTENT_NODE_NAME
public static final String RESULT_CONTENT_SOURCE_NODE_NAME
public static final String RESULT_CONTENT_SCORE_NODE_NAME
public static final String TOTAL_COUNT_NODE_NAME
public static final String NESTED_RESULT_NODE_NAME
public static <T> Page<T> convertSearchResult(com.fasterxml.jackson.databind.JsonNode searchResult, ElasticsearchResultConverter.ResultMapper<T> resultMapper, int start, int size)
public static <T> List<T> convertSearchResultToList(com.fasterxml.jackson.databind.JsonNode searchResult, ElasticsearchResultConverter.ResultMapper<T> resultMapper)
public static Optional<com.fasterxml.jackson.databind.node.ArrayNode> extractHits(com.fasterxml.jackson.databind.JsonNode resultNode)
public static Optional<com.fasterxml.jackson.databind.JsonNode> extractFirstContentSourceFromHits(com.fasterxml.jackson.databind.JsonNode resultNode)
protected static <T> List<T> convertHits(com.fasterxml.jackson.databind.JsonNode hitsRoot, ElasticsearchResultConverter.ResultMapper<T> resultMapper)
public static long getHitsTotalCount(com.fasterxml.jackson.databind.JsonNode hitsRoot)