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 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

      OptionalLong getReindexAllProgress(SearchIndexDefinition indexDefinition)
      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

      WritableFuture<Long> reindexAll(SearchIndexDefinition indexDefinition)
      Launch a full reindex of an index.
      Parameters:
      indexDefinition - Index type
      Returns:
      Future of number elements indexed
    • reindexAllModified

      WritableFuture<Long> reindexAllModified(SearchIndexDefinition searchIndexDefinition)
      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

      WritableFuture<Long> reindexDelta(SearchIndexDefinition searchIndexDefinition)
      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 indexed
      I - Type of the object representing the index
      Parameters:
      indexDefinition - Index type
      indexCollection - 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 indexed
      I - Type of the object representing the index
      Parameters:
      indexDefinition - Index type
      index - 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 type
      searchQuery - Initial criteria
      listState - 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 criteria
      listState - List state (sorting and pagination)
      indexDefinition - Index type
      Returns:
      Result matching the query
    • count

      long count(SearchIndexDefinition indexDefinition)
      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 type
      uid - UID of the resource to delete
    • removeAll

      void removeAll(SearchIndexDefinition indexDefinition, ListFilter listFilter)
      Delete data matching a filter.
      Parameters:
      indexDefinition - Index type
      listFilter - Filter of items to delete
    • putMetaData

      void putMetaData(SearchIndexDefinition indexDefinition, String dataPath, Serializable dataValue)
      Add metadata to the index. If the item was already in the index it is replaced.
      Parameters:
      indexDefinition - Index type
      dataPath - Metadata key
      dataValue - Metadata value
    • getMetaData

      Serializable getMetaData(SearchIndexDefinition indexDefinition, String dataPath)
      Read metadata from the index.
      Parameters:
      indexDefinition - Index type
      dataPath - Metadata key
      Returns:
      Metadata value, null if no data
    • waitForRefresh

      void waitForRefresh(Class<? extends io.vertigo.datamodel.data.model.KeyConcept> keyConceptClass)
      Wait for the end of the refresh of the index corresponding to the keyConcept class.
      Parameters:
      keyConceptClass - keyConcept class