Interface IndexManager

All Known Implementing Classes:
IndexManagerImpl

public interface IndexManager
  • Method Details

    • getIndexNamePrefix

      String getIndexNamePrefix()
      Returns the prefix that is added to all indices. Empty by default.
    • getESIndexName

      String getESIndexName(String indexName)
      Returns the internal index name for the provided raw index name. As there might be an index-prefix in place, the index name towards the Elasticsearch client needs to use the internal name though which is returned using this method.
      Parameters:
      indexName - the index name as being used in configuration, query DSL and API
      Returns:
      the index name as being used towards Elasticsearch (might have a prefix)
    • createIndexWithAlias

      com.fasterxml.jackson.databind.JsonNode createIndexWithAlias(String alias)
      Creates an index. The index mapping that is used will need to have as 'name' the passed index name. In fact, creates both an alias with the given name and the actual index, prefixed with the project name and with a timestamp. This allows later to change indices, but keep the alias and reindex.
    • createIndexWithoutAlias

      String createIndexWithoutAlias(String index)
      Similar to createIndexWithAlias(String), but doesn't create an alias, only the index with the mapping. Note that the index will still follow the aliasName-timeStamp pattern. Note that the mapping will be looked up based on the name passed.
    • recreateMapping

      IndexMapping recreateMapping(IndexMapping indexMapping)
      Used to recreate mapping if CustomIndexConfiguration changed.
      Parameters:
      indexMapping -
      Returns:
      Updated indexMapping
    • getCustomQueryMapping

      IndexMapping getCustomQueryMapping(String indexName, String mappingName)
      Get custom query mapping for given index if exists.
    • deleteAliasAndRelatedIndices

      void deleteAliasAndRelatedIndices(String alias)
      Deletes the given index and all its aliases. Or, when the name is an alias, deletes the alias and all indices.
    • deleteIndex

      void deleteIndex(String indexName)
      Deletes the index with the given name. Does not delete the alias, if one exists.
    • deleteAllKnownIndices

      void deleteAllKnownIndices()
      Deletes all indices registered in the system
    • isKnownIndex

      boolean isKnownIndex(String index)
      Returns whether the index is a known mapped index. This is useful when parsing queries.
    • findMatchingIndexMappings

      List<IndexMapping> findMatchingIndexMappings(com.fasterxml.jackson.databind.node.ObjectNode objectNode)
      Returns a list of IndexMapping instances that are applicable for the provided data.
    • findMatchingIndexMappings

      List<IndexMapping> findMatchingIndexMappings(String mappingType)
      Returns a list of IndexMapping(s) that are applicable for the provided mapping type.
    • findMatchingCustomMappings

      List<IndexMapping> findMatchingCustomMappings(String indexName)
      Returns a list of IndexMapping(s) that are applicable for the provided index name.
    • findIndexMapping

      IndexMapping findIndexMapping(String indexName)
    • getIndexConfiguration

      CustomIndexConfiguration getIndexConfiguration(String indexName)
      Returns the mapping information for the given index.
    • createIndexesFromMappings

      Map<String,com.fasterxml.jackson.databind.JsonNode> createIndexesFromMappings()
      Creates the indices for all known mappings
    • createIndexesAndCustomAliasesFromMappings

      void createIndexesAndCustomAliasesFromMappings()
    • reloadIndices

      boolean reloadIndices()
      Reloads all indexes
    • reloadIndex

      boolean reloadIndex(String alias)
      Reloads selected index