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_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) |
protected static String |
escape(String s) |
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,String> configParams) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
handleQueryWithTemplate(Map<String,Object> params,
CustomIndexConfiguration customIndexConfiguration) |
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(IndexMapping indexMapping, Map<String,Object> params)
protected com.fasterxml.jackson.databind.node.ObjectNode handleQueryWithCustomFilter(IndexMapping indexMapping, CustomIndexConfiguration customIndexConfiguration, Map<String,Object> params, Map<String,String> configParams)
protected com.fasterxml.jackson.databind.node.ObjectNode handleQueryWithTemplate(Map<String,Object> params, CustomIndexConfiguration customIndexConfiguration)
public com.fasterxml.jackson.databind.node.ObjectNode getSourceById(String index, String id)
SearchService
getSourceById
in interface SearchService
Copyright © 2019. All rights reserved.