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, indexTaskPartitionSize, localeResolverService, logger, moduleManager, pageLoaderPartitionSize, persistenceService, queryBuilderFactory, queryProcessorService, securityManager, taskSchedulingService, textResources, typeManager -
Constructor Summary
ConstructorsConstructorDescriptionElasticSearchFulltextIndexService(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 voiddeleteByEntityModel(EntityModel entityModel) voiddeleteByIds(List<String> ids) protected voiddeleteByQuery(FulltextSearchQuery fulltextSearchQuery) protected voiddoAddEntity(Entity entity) protected voiddoDeleteEntity(EntityId entityId) protected voiddoUpdateEntity(Entity entity) fetchSuggestions(String queryString) Runs a suggestion query against the index with the specified query string.protected voidhandleIndexingForEntity(EntityList entityList) protected FulltextSearchResponseImplhandleQuery(FulltextSearchQuery fulltextSearchQuery) voidinit()protected FulltextSearchQuerysetIndexFixPagingParams(FulltextSearchQuery fulltextSearchQuery, int limit, PagedLoader.StartParam<FulltextSearchResponse.Document> startParam) Override this method to set different paging params than limit and offset (e.g.voidsetSearchFields(String searchFields) voidSetup mapping in a new indexvoidTruncates (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:FulltextIndexServiceSetup mapping in a new index -
handleIndexingForEntity
- Specified by:
handleIndexingForEntityin classAbstractFulltextIndexService<Void>
-
truncateIndex
public void truncateIndex()Description copied from interface:FulltextIndexServiceTruncates (remove all records) the whole index. USE WITH CARE! This method can only be executed once per instance. -
doAddEntity
- Specified by:
doAddEntityin classAbstractFulltextIndexService<Void>
-
doUpdateEntity
- Specified by:
doUpdateEntityin classAbstractFulltextIndexService<Void>
-
doDeleteEntity
- Specified by:
doDeleteEntityin classAbstractFulltextIndexService<Void>
-
deleteByEntityModel
- Specified by:
deleteByEntityModelin classAbstractFulltextIndexService<Void>
-
setIndexFixPagingParams
protected FulltextSearchQuery setIndexFixPagingParams(FulltextSearchQuery fulltextSearchQuery, int limit, PagedLoader.StartParam<FulltextSearchResponse.Document> startParam) Description copied from class:AbstractFulltextIndexServiceOverride this method to set different paging params than limit and offset (e.g. `#searchAfter()`)- Overrides:
setIndexFixPagingParamsin classAbstractFulltextIndexService<Void>
-
handleQuery
- Specified by:
handleQueryin classAbstractFulltextIndexService<Void>
-
deleteByQuery
- Specified by:
deleteByQueryin classAbstractFulltextIndexService<Void>
-
deleteByIds
- Specified by:
deleteByIdsin classAbstractFulltextIndexService<Void>
-
fetchSuggestions
Description copied from interface:FulltextIndexServiceRuns 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
-