@Component public class ElasticsearchHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BDEF_TAG_CODE_FIELD
The tag code field
|
static String |
BDEF_TAG_NAME_FIELD
The tag display name field
|
static String |
BDEF_TAGTYPE_CODE_FIELD
The tag type code field
|
static String |
BDEF_TAGTYPE_NAME_FIELD
The tag type display name field
|
static String |
DISPLAY_NAME_SOURCE
Source string for the display name
|
static String |
NESTED_BDEFTAGS_PATH
The nested path of business object definition tags
|
static String |
RESULT_TYPE_AGGS
The result type agg
|
static String |
RESULT_TYPE_FACET
the result type Facet
|
static String |
RESULT_TYPE_FIELD |
static String |
TAG_CODE_AGGREGATION
The user defined tag code sub aggregation name.
|
static String |
TAG_CODE_FIELD_TAG_INDEX
The tag code field from tag index
|
static String |
TAG_FACET
The tag Facet Field name
|
static String |
TAG_FACET_AGGS
The nested aggregation name for tag facet.
|
static String |
TAG_NAME_AGGREGATION
The user defined tag display name sub aggregation name.
|
static String |
TAG_NAME_FIELD_TAG_INDEX
The tag display name field from tag index
|
static String |
TAG_TAG_CODE_FIELD
The tagCode field
|
static String |
TAG_TAGTYPE_CODE_FIELD
The tag type code field
|
static String |
TAG_TYPE_FACET_AGGS
The user defined agg name for tag type facet.
|
static String |
TAGTYPE_CODE_AGGREGATION
The user defined tag type code sub aggregation name.
|
static String |
TAGTYPE_CODE_FIELD_TAG_INDEX
The tag type code field from tag index
|
static String |
TAGTYPE_NAME_AGGREGATION
The user defined tag type display name sub aggregation name.
|
static String |
TAGTYPE_NAME_FIELD_TAG_INDEX
The tag type display name field from tag index
|
| Constructor and Description |
|---|
ElasticsearchHelper() |
| Modifier and Type | Method and Description |
|---|---|
SearchRequestBuilder |
addFacetFieldAggregations(Set<String> facetFieldsList,
SearchRequestBuilder searchRequestBuilder)
Adds facet field aggregations
|
BoolQueryBuilder |
addIndexSearchFilterBooleanClause(List<IndexSearchFilter> indexSearchFilters,
String bdefActiveIndex,
String tagActiveIndex)
Navigates the specified index search filters and adds boolean filter clauses to a given
SearchRequestBuilder |
Terms |
getAggregation(SearchResponse searchResponse,
String aggregationName)
Returns the aggregation that is associated with the specified name.
|
protected Aggregations |
getAggregationsFromNestedAggregation(Nested nestedAggregation,
SearchResponse searchResponse)
Returns a representation of a set of aggregations from the nested aggregation.
|
protected Aggregations |
getAggregationsFromSearchResponse(SearchResponse searchResponse)
Returns a representation of a set of aggregations from the search response.
|
List<Facet> |
getFacetsResponse(ElasticsearchResponseDto elasticsearchResponseDto,
String bdefActiveIndex,
String tagActiveIndex)
get the facets in the response
|
Terms |
getNestedAggregation(SearchResponse searchResponse,
String nestedAggregationName,
String subAggregationName)
Returns the sub-aggregation that is associated with the specified nested aggregation.
|
List<TagTypeIndexSearchResponseDto> |
getNestedTagTagIndexSearchResponseDto(SearchResponse searchResponse)
create tag tag index response dto
|
List<TagTypeIndexSearchResponseDto> |
getNestedTagTagIndexSearchResponseDto(SearchResult searchResult)
create tag tag index response dto
|
List<ResultTypeIndexSearchResponseDto> |
getResultTypeIndexSearchResponseDto(SearchResponse searchResponse)
Creates result type facet response dto
|
List<ResultTypeIndexSearchResponseDto> |
getResultTypeIndexSearchResponseDto(SearchResult searchResult)
Creates result type facet response dto
|
String |
getSearchIndexType(String indexName,
String bdefActiveIndex,
String tagActiveIndex)
Return the relative search index type for the index name.
|
List<TagTypeIndexSearchResponseDto> |
getTagTagIndexSearchResponseDto(SearchResponse searchResponse)
get tag index search response dto
|
List<TagTypeIndexSearchResponseDto> |
getTagTagIndexSearchResponseDto(SearchResult searchResult)
get tag index search response dto
|
public static final String DISPLAY_NAME_SOURCE
public static final String NESTED_BDEFTAGS_PATH
public static final String TAGTYPE_CODE_FIELD_TAG_INDEX
public static final String TAGTYPE_NAME_FIELD_TAG_INDEX
public static final String TAG_CODE_FIELD_TAG_INDEX
public static final String TAG_NAME_FIELD_TAG_INDEX
public static final String BDEF_TAGTYPE_CODE_FIELD
public static final String BDEF_TAGTYPE_NAME_FIELD
public static final String BDEF_TAG_CODE_FIELD
public static final String BDEF_TAG_NAME_FIELD
public static final String TAG_TAG_CODE_FIELD
public static final String TAG_TAGTYPE_CODE_FIELD
public static final String TAG_FACET_AGGS
public static final String TAGTYPE_CODE_AGGREGATION
public static final String TAGTYPE_NAME_AGGREGATION
public static final String TAG_CODE_AGGREGATION
public static final String TAG_NAME_AGGREGATION
public static final String TAG_FACET
public static final String RESULT_TYPE_FACET
public static final String TAG_TYPE_FACET_AGGS
public static final String RESULT_TYPE_AGGS
public static final String RESULT_TYPE_FIELD
public SearchRequestBuilder addFacetFieldAggregations(Set<String> facetFieldsList, SearchRequestBuilder searchRequestBuilder)
facetFieldsList - facet field listsearchRequestBuilder - search request builderpublic BoolQueryBuilder addIndexSearchFilterBooleanClause(List<IndexSearchFilter> indexSearchFilters, String bdefActiveIndex, String tagActiveIndex)
SearchRequestBuilderindexSearchFilters - the specified search filtersbdefActiveIndex - the active bdef index nametagActiveIndex - the active tag index namepublic List<ResultTypeIndexSearchResponseDto> getResultTypeIndexSearchResponseDto(SearchResponse searchResponse)
searchResponse - search responsepublic List<ResultTypeIndexSearchResponseDto> getResultTypeIndexSearchResponseDto(SearchResult searchResult)
searchResult - search resultpublic List<TagTypeIndexSearchResponseDto> getTagTagIndexSearchResponseDto(SearchResponse searchResponse)
searchResponse - elastic search responsepublic List<TagTypeIndexSearchResponseDto> getTagTagIndexSearchResponseDto(SearchResult searchResult)
searchResult - elastic search resultpublic List<TagTypeIndexSearchResponseDto> getNestedTagTagIndexSearchResponseDto(SearchResponse searchResponse)
searchResponse - search responsepublic List<TagTypeIndexSearchResponseDto> getNestedTagTagIndexSearchResponseDto(SearchResult searchResult)
searchResult - search resultpublic List<Facet> getFacetsResponse(ElasticsearchResponseDto elasticsearchResponseDto, String bdefActiveIndex, String tagActiveIndex)
elasticsearchResponseDto - elastic search response dtobdefActiveIndex - the name of the active index for business object definitionstagActiveIndex - the name os the active index for tagspublic Terms getAggregation(SearchResponse searchResponse,
String aggregationName)
searchResponse - the response of the search requestaggregationName - the name of the aggregationpublic Terms getNestedAggregation(SearchResponse searchResponse,
String nestedAggregationName,
String subAggregationName)
searchResponse - the response of the search requestnestedAggregationName - the name of the nested aggregationsubAggregationName - the name of the sub-aggregationpublic String getSearchIndexType(String indexName, String bdefActiveIndex, String tagActiveIndex)
indexName - the name of the indexbdefActiveIndex - the name of the active index for business object definitionstagActiveIndex - the name os the active index for tagsprotected Aggregations getAggregationsFromNestedAggregation(Nested nestedAggregation,
SearchResponse searchResponse)
nestedAggregation - the nested aggregationsearchResponse - the response of the search requestprotected Aggregations getAggregationsFromSearchResponse(SearchResponse searchResponse)
searchResponse - the response of the search requestCopyright © 2019. All rights reserved.