public class SearchServiceImpl extends Object implements SearchService
Modifier and Type | Field and Description |
---|---|
protected ElasticsearchClient |
elasticsearchClient |
protected IndexManager |
indexManager |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected List<LowLevelSearchResultEnhancer> |
searchResultEnhancers |
protected IndexQueryTemplateResourceHelper |
templateResourceHelper |
CUSTOM_QUERY_CURRENT_GROUPS, CUSTOM_QUERY_CURRENT_TENANT_ID, CUSTOM_QUERY_CURRENT_TIME, CUSTOM_QUERY_CURRENT_USER_ID
Constructor and Description |
---|
SearchServiceImpl(ElasticsearchClient elasticsearchClient,
IndexManager indexManager,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
ResourceHelper resourceHelper,
List<LowLevelSearchResultEnhancer> searchResultEnhancers) |
Modifier and Type | Method and Description |
---|---|
com.fasterxml.jackson.databind.node.ObjectNode |
createCustomQueryForParameters(IndexMapping indexMapping,
Map<String,Object> params) |
com.fasterxml.jackson.databind.node.ObjectNode |
createCustomQueryForParameters(com.fasterxml.jackson.databind.JsonNode customFilter,
String queryName,
Map<String,ConfigParameter> configParameters,
Map<String,Object> payload) |
com.fasterxml.jackson.databind.node.ObjectNode |
createCustomQueryForParameters(String templateResource,
Map<String,Object> payload) |
protected static String |
escape(String s) |
protected static String |
escapeStringType(String s) |
protected Stream<String> |
getParamsStreamValue(String paramKey,
Map<String,Object> params,
ConfigParameter configParameter,
String configName) |
protected String |
getParamsStringValue(String paramKey,
Map<String,Object> params,
ConfigParameter configParameter,
String configName) |
com.fasterxml.jackson.databind.node.ObjectNode |
getSourceById(String index,
String id)
This queries by id and removes the boilerplate json (_shards, hits, etc) from the result:
it only returns the _source element of the query result.
|
protected String |
groupIdsToJsonArray(Set<String> groups) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
handleQueryWithCustomFilter(IndexMapping indexMapping,
CustomIndexConfiguration customIndexConfiguration,
Map<String,Object> params,
Map<String,ConfigParameter> configParams) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
handleQueryWithCustomFilter(String indexMapping,
String configName,
Map<String,Object> params,
Map<String,ConfigParameter> configParams) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
handleQueryWithTemplate(Map<String,Object> params,
CustomIndexConfiguration customIndexConfiguration) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
handleQueryWithTemplate(Map<String,Object> params,
String templateResource) |
com.fasterxml.jackson.databind.JsonNode |
query(String index,
String queryBody) |
com.fasterxml.jackson.databind.node.ObjectNode |
resolveCustomQuery(String indexName,
String queryName,
Map<String,Object> params) |
protected ElasticsearchClient elasticsearchClient
protected IndexManager indexManager
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
protected List<LowLevelSearchResultEnhancer> searchResultEnhancers
protected IndexQueryTemplateResourceHelper templateResourceHelper
public SearchServiceImpl(ElasticsearchClient elasticsearchClient, IndexManager indexManager, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ResourceHelper resourceHelper, List<LowLevelSearchResultEnhancer> searchResultEnhancers)
public com.fasterxml.jackson.databind.JsonNode query(String index, String queryBody)
query
in interface SearchService
public com.fasterxml.jackson.databind.node.ObjectNode resolveCustomQuery(String indexName, String queryName, Map<String,Object> params)
resolveCustomQuery
in interface SearchService
public com.fasterxml.jackson.databind.node.ObjectNode createCustomQueryForParameters(com.fasterxml.jackson.databind.JsonNode customFilter, String queryName, Map<String,ConfigParameter> configParameters, Map<String,Object> payload)
createCustomQueryForParameters
in interface SearchService
public com.fasterxml.jackson.databind.node.ObjectNode createCustomQueryForParameters(String templateResource, Map<String,Object> payload)
createCustomQueryForParameters
in interface SearchService
public com.fasterxml.jackson.databind.node.ObjectNode createCustomQueryForParameters(IndexMapping indexMapping, Map<String,Object> params)
protected com.fasterxml.jackson.databind.node.ObjectNode handleQueryWithCustomFilter(IndexMapping indexMapping, CustomIndexConfiguration customIndexConfiguration, Map<String,Object> params, Map<String,ConfigParameter> configParams)
protected com.fasterxml.jackson.databind.node.ObjectNode handleQueryWithCustomFilter(String indexMapping, String configName, Map<String,Object> params, Map<String,ConfigParameter> configParams)
protected com.fasterxml.jackson.databind.node.ObjectNode handleQueryWithTemplate(Map<String,Object> params, CustomIndexConfiguration customIndexConfiguration)
protected com.fasterxml.jackson.databind.node.ObjectNode handleQueryWithTemplate(Map<String,Object> params, String templateResource)
protected String getParamsStringValue(String paramKey, Map<String,Object> params, ConfigParameter configParameter, String configName)
protected Stream<String> getParamsStreamValue(String paramKey, Map<String,Object> params, ConfigParameter configParameter, String configName)
public com.fasterxml.jackson.databind.node.ObjectNode getSourceById(String index, String id)
SearchService
getSourceById
in interface SearchService