Class ElasticSearchFulltextIndexService
java.lang.Object
ch.tocco.nice2.enterprisesearch.impl.AbstractFulltextIndexService<Void>
ch.tocco.nice2.enterprisesearch.impl.elasticsearch.ElasticSearchFulltextIndexService
- All Implemented Interfaces:
FulltextIndexService
@Component
@ConditionalOnProperty(name="nice2.enterprisesearch.elasticsearch.hostName")
public class ElasticSearchFulltextIndexService
extends AbstractFulltextIndexService<Void>
-
Field Summary
Fields inherited from class ch.tocco.nice2.enterprisesearch.impl.AbstractFulltextIndexService
businessUnitManager, commandExecutor, context, dataModel, dataSource, defaultDisplayService, exclusiveOperationInProgress, extractors, localeResolverService, logger, moduleManager, pageLoaderPartitionSize, persistenceService, queryBuilderFactory, queryProcessorService, securityManager, taskSchedulingService, textResources, typeManager
-
Constructor Summary
ConstructorDescriptionElasticSearchFulltextIndexService
(DataModel dataModel, Context context, PersistenceService persistenceService, QueryProcessorService queryProcessorService, DefaultDisplayService defaultDisplayService, BusinessUnitManager businessUnitManager, QueryBuilderFactory queryBuilderFactory, SecurityManager securityManager, LocaleResolverService localeResolverService, TaskSchedulingService taskSchedulingService, DataSource dataSource, TextResources textResources, TypeManager typeManager, org.slf4j.Logger logger, CommandExecutor commandExecutor, ModuleManager moduleManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
deleteByEntityModel
(EntityModel entityModel) void
deleteByIds
(List<String> ids) protected void
deleteByQuery
(FulltextSearchQuery fulltextSearchQuery) protected void
doAddEntity
(Entity entity) protected void
doDeleteEntity
(EntityId entityId) protected void
doUpdateEntity
(Entity entity) fetchSuggestions
(String queryString) Runs a suggestion query against the index with the specified query string.protected void
handleIndexingForEntity
(EntityList entityList) protected FulltextSearchResponseImpl
handleQuery
(FulltextSearchQuery fulltextSearchQuery) void
init()
protected FulltextSearchQuery
setIndexFixPagingParams
(FulltextSearchQuery fulltextSearchQuery, int limit, PagedLoader.StartParam<FulltextSearchResponse.Document> startParam) Override this method to set different paging params than limit and offset (e.g.void
setSearchFields
(String searchFields) void
Setup mapping in a new indexvoid
Truncates (remove all records) the whole index.Methods inherited from class ch.tocco.nice2.enterprisesearch.impl.AbstractFulltextIndexService
addEntity, checkIndexForEntity, deleteEntity, filterEntityTypes, fixIndex, fixIndexForEntity, getExtractorResult, getIndexPriority, handleSecurity, isIndexed, prepareQuery, query, runAsAnonymous, runCompleteIndexCheck, runCompleteIndexing, runIndexingForEntity, setExtractors, updateEntity, wasTaskRun
-
Constructor Details
-
ElasticSearchFulltextIndexService
public ElasticSearchFulltextIndexService(DataModel dataModel, Context context, PersistenceService persistenceService, QueryProcessorService queryProcessorService, DefaultDisplayService defaultDisplayService, BusinessUnitManager businessUnitManager, QueryBuilderFactory queryBuilderFactory, SecurityManager securityManager, LocaleResolverService localeResolverService, TaskSchedulingService taskSchedulingService, DataSource dataSource, TextResources textResources, TypeManager typeManager, org.slf4j.Logger logger, CommandExecutor commandExecutor, ModuleManager moduleManager)
-
-
Method Details
-
init
@PostConstruct public void init() -
setSearchFields
@Value("${nice2.enterprisesearch.elasticsearch.searchFields}") public void setSearchFields(String searchFields) -
setupIndex
public void setupIndex()Description copied from interface:FulltextIndexService
Setup mapping in a new index -
handleIndexingForEntity
- Specified by:
handleIndexingForEntity
in classAbstractFulltextIndexService<Void>
-
truncateIndex
public void truncateIndex()Description copied from interface:FulltextIndexService
Truncates (remove all records) the whole index. USE WITH CARE! This method can only be executed once per instance. -
doAddEntity
- Specified by:
doAddEntity
in classAbstractFulltextIndexService<Void>
-
doUpdateEntity
- Specified by:
doUpdateEntity
in classAbstractFulltextIndexService<Void>
-
doDeleteEntity
- Specified by:
doDeleteEntity
in classAbstractFulltextIndexService<Void>
-
deleteByEntityModel
- Specified by:
deleteByEntityModel
in classAbstractFulltextIndexService<Void>
-
setIndexFixPagingParams
protected FulltextSearchQuery setIndexFixPagingParams(FulltextSearchQuery fulltextSearchQuery, int limit, PagedLoader.StartParam<FulltextSearchResponse.Document> startParam) Description copied from class:AbstractFulltextIndexService
Override this method to set different paging params than limit and offset (e.g. `#searchAfter()`)- Overrides:
setIndexFixPagingParams
in classAbstractFulltextIndexService<Void>
-
handleQuery
- Specified by:
handleQuery
in classAbstractFulltextIndexService<Void>
-
deleteByQuery
- Specified by:
deleteByQuery
in classAbstractFulltextIndexService<Void>
-
deleteByIds
- Specified by:
deleteByIds
in classAbstractFulltextIndexService<Void>
-
fetchSuggestions
Description copied from interface:FulltextIndexService
Runs a suggestion query against the index with the specified query string.- Parameters:
queryString
- any query string in lucene syntax- Returns:
- a list of strings with suggestions
-