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 TypeMethodDescriptionvoidAdds the specified entity to the index.booleancheckIndexForEntity(String entityModelName) Check the index for the specified entity model.voiddeleteEntity(EntityId entityId) Removes the specified entity from the index.fetchSuggestions(String queryString) Runs a suggestion query against the index with the specified query string.voidfixIndex()query(FulltextSearchQuery fulltextSearchQuery) Query the index with the specified fulltext search query.voidCheck the whole index.voidDo a complete indexing of the whole database.voidrunIndexingForEntity(String entityModelName) Do indexing of the specified entity model.default voidSetup mapping in a new indexvoidTruncates (remove all records) the whole index.voidupdateEntity(Entity entity) Updates the specified entity to the index.booleanwasTaskRun(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
-