Interface FulltextIndexService
- All Known Implementing Classes:
AbstractFulltextIndexService
,ElasticSearchFulltextIndexService
,FakeFulltextIndexService
public interface FulltextIndexService
This is the main service of the enterprise search functionality.
It provides the interface to the underlying index engine.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified entity to the index.boolean
checkIndexForEntity
(String entityModelName) Check the index for the specified entity model.void
deleteEntity
(EntityId entityId) Removes the specified entity from the index.fetchSuggestions
(String queryString) Runs a suggestion query against the index with the specified query string.void
fixIndex()
query
(FulltextSearchQuery fulltextSearchQuery) Query the index with the specified fulltext search query.void
Check the whole index.void
Do a complete indexing of the whole database.void
runIndexingForEntity
(String entityModelName) Do indexing of the specified entity model.default void
Setup mapping in a new indexvoid
Truncates (remove all records) the whole index.void
updateEntity
(Entity entity) Updates the specified entity to the index.boolean
wasTaskRun
(String taskName) returns true if the task already ran for the current revision
-
Method Details
-
setupIndex
default void setupIndex()Setup mapping in a new index -
runCompleteIndexing
void runCompleteIndexing()Do a complete indexing of the whole database. It iterates over all entity types and starts with the ones with the highest indexing-priority. Entity types with indexing-priority of -1 are not included. This method can only be executed once per instance.- See Also:
-
runIndexingForEntity
Do indexing of the specified entity model.- Parameters:
entityModelName
- a valid entity model name- See Also:
-
runCompleteIndexCheck
void runCompleteIndexCheck()Check the whole index. It checks first if the count of a entity model matches (database vs. index) and the checks the version of each record. This method can only be executed once per instance.- See Also:
-
checkIndexForEntity
Check the index for the specified entity model.- Parameters:
entityModelName
- a valid entity model name- See Also:
-
fixIndex
void fixIndex() -
wasTaskRun
returns true if the task already ran for the current revision -
truncateIndex
void truncateIndex()Truncates (remove all records) the whole index. USE WITH CARE! This method can only be executed once per instance. -
addEntity
Adds the specified entity to the index. This is / should used only internally by updating listener.- Parameters:
entity
- a entity to do the specified operation with
-
updateEntity
Updates the specified entity to the index. This is / should used only internally by updating listener.- Parameters:
entity
- a entity to do the specified operation with
-
deleteEntity
Removes the specified entity from the index. This is / should used only internally by updating listener.- Parameters:
entityId
- an entity-id to do the specified operation with
-
query
Query the index with the specified fulltext search query.- Parameters:
fulltextSearchQuery
- a fulltext search query object- Returns:
- a fulltext search response object
-
fetchSuggestions
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
-