Package io.vertigo.datafactory.search
Interface SearchManager
- All Superinterfaces:
io.vertigo.core.node.component.Component,io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Manager
- All Known Implementing Classes:
SearchManagerImpl
public interface SearchManager
extends io.vertigo.core.node.component.Manager
Search indexes manager.
- Author:
- dchallas, npiedeloup
-
Method Summary
Modifier and TypeMethodDescriptionlongcount(SearchIndexDefinition indexDefinition) findFirstIndexDefinitionByKeyConcept(Class<? extends io.vertigo.datamodel.data.model.KeyConcept> keyConceptClass) Find IndexDefinition for a keyConcept.getMetaData(SearchIndexDefinition indexDefinition, String dataPath) Read metadata from the index.getReindexAllProgress(SearchIndexDefinition indexDefinition) Get progress of a complete reindex of an index.<I extends io.vertigo.datamodel.data.model.DataObject>
FacetedQueryResult<I, SearchQuery> loadList(SearchIndexDefinition indexDefinition, SearchQuery searchQuery, io.vertigo.datamodel.data.model.DtListState listState) Retrieve the result of a query.<I extends io.vertigo.datamodel.data.model.DataObject>
FacetedQueryResult<I, SearchQuery> loadList(List<SearchIndexDefinition> indexDefinitions, SearchQuery searchQuery, io.vertigo.datamodel.data.model.DtListState listState) Retrieve the result of a query.voidmarkAsDirty(List<io.vertigo.datamodel.data.model.UID<? extends io.vertigo.datamodel.data.model.KeyConcept>> keyConceptUIDs) Mark a UID list as dirty.<K extends io.vertigo.datamodel.data.model.KeyConcept,I extends io.vertigo.datamodel.data.model.DataObject>
voidput(SearchIndexDefinition indexDefinition, SearchIndex<K, I> index) Add a resource to the index.<K extends io.vertigo.datamodel.data.model.KeyConcept,I extends io.vertigo.datamodel.data.model.DataObject>
voidputAll(SearchIndexDefinition indexDefinition, Collection<SearchIndex<K, I>> indexCollection) Add multiple resources to the index.voidputMetaData(SearchIndexDefinition indexDefinition, String dataPath, Serializable dataValue) Add metadata to the index.reindexAll(SearchIndexDefinition indexDefinition) Launch a full reindex of an index.reindexAllModified(SearchIndexDefinition searchIndexDefinition) Launch a full reindex of an index, checking modified data to limit updates (based on a version field).reindexDelta(SearchIndexDefinition searchIndexDefinition) Launch a delta reindex of an index based on a version field (like lastModified or version).<K extends io.vertigo.datamodel.data.model.KeyConcept>
voidremove(SearchIndexDefinition indexDefinition, io.vertigo.datamodel.data.model.UID<K> uid) Delete a resource from the index.voidremoveAll(SearchIndexDefinition indexDefinition, ListFilter listFilter) Delete data matching a filter.voidwaitForRefresh(Class<? extends io.vertigo.datamodel.data.model.KeyConcept> keyConceptClass) Wait for the end of the refresh of the index corresponding to the keyConcept class.
-
Method Details
-
findFirstIndexDefinitionByKeyConcept
SearchIndexDefinition findFirstIndexDefinitionByKeyConcept(Class<? extends io.vertigo.datamodel.data.model.KeyConcept> keyConceptClass) Find IndexDefinition for a keyConcept. It must be one and only one IndexDefinition.- Parameters:
keyConceptClass- keyConcept class- Returns:
- SearchIndexDefinition for this keyConcept (not null)
-
markAsDirty
void markAsDirty(List<io.vertigo.datamodel.data.model.UID<? extends io.vertigo.datamodel.data.model.KeyConcept>> keyConceptUIDs) Mark a UID list as dirty. Index entries for these elements will be reindexed. Reindexing is asynchronous; strategy depends on plugin parameters.- Parameters:
keyConceptUIDs- UID of keyConcept marked as dirty.
-
getReindexAllProgress
Get progress of a complete reindex of an index.- Parameters:
indexDefinition- Index type- Returns:
- Progress of reindex, empty if no complete reindex in progress
-
reindexAll
Launch a full reindex of an index.- Parameters:
indexDefinition- Index type- Returns:
- Future of number elements indexed
-
reindexAllModified
Launch a full reindex of an index, checking modified data to limit updates (based on a version field).- Parameters:
indexDefinition- Index type- Returns:
- Future of number elements indexed
-
reindexDelta
Launch a delta reindex of an index based on a version field (like lastModified or version). Last value of this version field is stored into the index (as metadata).- Parameters:
indexDefinition- Index type- Returns:
- Future of number elements indexed
-
putAll
<K extends io.vertigo.datamodel.data.model.KeyConcept,I extends io.vertigo.datamodel.data.model.DataObject> void putAll(SearchIndexDefinition indexDefinition, Collection<SearchIndex<K, I>> indexCollection) Add multiple resources to the index. If the items were already in the index they are replaced.- Type Parameters:
K- Type of the keyConcept indexedI- Type of the object representing the index- Parameters:
indexDefinition- Index typeindexCollection- List of objects to push into the index
-
put
<K extends io.vertigo.datamodel.data.model.KeyConcept,I extends io.vertigo.datamodel.data.model.DataObject> void put(SearchIndexDefinition indexDefinition, SearchIndex<K, I> index) Add a resource to the index. If the item was already in the index it is replaced.- Type Parameters:
K- Type of the keyConcept indexedI- Type of the object representing the index- Parameters:
indexDefinition- Index typeindex- Object to push into the index
-
loadList
<I extends io.vertigo.datamodel.data.model.DataObject> FacetedQueryResult<I,SearchQuery> loadList(SearchIndexDefinition indexDefinition, SearchQuery searchQuery, io.vertigo.datamodel.data.model.DtListState listState) Retrieve the result of a query.- Type Parameters:
I- Type of the object returned by the search- Parameters:
indexDefinition- Index typesearchQuery- Initial criterialistState- List state (sorting and pagination)- Returns:
- Result matching the query
-
loadList
<I extends io.vertigo.datamodel.data.model.DataObject> FacetedQueryResult<I,SearchQuery> loadList(List<SearchIndexDefinition> indexDefinitions, SearchQuery searchQuery, io.vertigo.datamodel.data.model.DtListState listState) Retrieve the result of a query.- Type Parameters:
I- Type of the object returned by the search- Parameters:
searchQuery- Initial criterialistState- List state (sorting and pagination)indexDefinition- Index type- Returns:
- Result matching the query
-
count
- Parameters:
indexDefinition- Index type- Returns:
- Number of indexed documents
-
remove
<K extends io.vertigo.datamodel.data.model.KeyConcept> void remove(SearchIndexDefinition indexDefinition, io.vertigo.datamodel.data.model.UID<K> uid) Delete a resource from the index.- Type Parameters:
K- Type of the keyConcept indexed- Parameters:
indexDefinition- Index typeuid- UID of the resource to delete
-
removeAll
Delete data matching a filter.- Parameters:
indexDefinition- Index typelistFilter- Filter of items to delete
-
putMetaData
Add metadata to the index. If the item was already in the index it is replaced.- Parameters:
indexDefinition- Index typedataPath- Metadata keydataValue- Metadata value
-
getMetaData
Read metadata from the index.- Parameters:
indexDefinition- Index typedataPath- Metadata key- Returns:
- Metadata value, null if no data
-
waitForRefresh
Wait for the end of the refresh of the index corresponding to the keyConcept class.- Parameters:
keyConceptClass- keyConcept class
-