Interface ElasticSearchAdmin

    • Method Detail

      • getClient

        ESClient getClient()
        Retrieves the Client that can be used to access Elasticsearch API
        Since:
        5.9.3
      • initIndexes

        void initIndexes​(boolean dropIfExists)
        Initialize Elasticsearch indexes. Setup the index settings and mapping for each index that has been registered.
        Parameters:
        dropIfExists - if {true} remove an existing index
        Since:
        5.9.3
      • dropAndInitIndex

        void dropAndInitIndex​(String indexName)
        Reinitialize an index. This will drop the existing index, recreate it with its settings and mapping, the index will be empty.
        Since:
        7.3
      • dropAndInitRepositoryIndex

        default void dropAndInitRepositoryIndex​(String repositoryName)
        Reinitialize the index of a repository. This will drop the existing index, recreate it with its settings and mapping, the index will be empty.
        Since:
        7.1
      • dropAndInitRepositoryIndex

        void dropAndInitRepositoryIndex​(String repositoryName,
                                        boolean syncAlias)
        Reinitialize the index of a repository. This will drop the existing index, recreate it with its settings and mapping, the index will be empty. When syncAlias is false then search alias is not updated with the new index, you need to explicitly call syncSearchAndWriteAlias(String)
        Since:
        9.3
      • initRepositoryIndexWithAliases

        void initRepositoryIndexWithAliases​(String repositoryName)
        Creates a new index for the repository applying the mapping and settings. Update the write alias to point to this new index. The search alias is updated to the new index only for the initial creation. Otherwise, there are two write indexes until an explicit call to syncSearchAndWriteAlias(String).
        Since:
        2021.12
      • getRepositoryNames

        List<String> getRepositoryNames()
        List repository names that have Elasticsearch support.
        Since:
        7.1
      • getIndexNameForRepository

        String getIndexNameForRepository​(String repositoryName)
        Get the search index name associated with the repository name.
        Throws:
        NoSuchElementException - if there is no Elasticsearch index associated with the requested repository.
        Since:
        7.2
      • getRepositoryForIndex

        String getRepositoryForIndex​(String indexName)
        Gets the repository name associated with the index.
        Since:
        9.10
      • getIndexNamesForType

        List<String> getIndexNamesForType​(String type)
        Get the index names with the given type.
        Since:
        7.10
      • getIndexNameForType

        String getIndexNameForType​(String type)
        Get the first search index name with the given type.
        Throws:
        NoSuchElementException - if there is no Elasticsearch index with the given type.
        Since:
        7.10
      • getWriteIndexName

        String getWriteIndexName​(String searchIndexName)
        Returns the index to use for any write operations.
        Since:
        9.3
      • getSecondaryWriteIndexName

        String getSecondaryWriteIndexName​(String searchIndexName)
        Returns the secondary write index used during re-indexing with aliases.
        Returns:
        an index name or null if there is no re-indexing in progress.
        Since:
        2021.12
      • syncSearchAndWriteAlias

        void syncSearchAndWriteAlias​(String searchIndexName)
        Make sure that the search alias point to the same index as the write alias.
        Since:
        9.3
      • isIndexingInProgress

        boolean isIndexingInProgress()
        Returns true if there are indexing activities scheduled or running.
        Since:
        5.9.5
      • prepareWaitForIndexing

        com.google.common.util.concurrent.ListenableFuture<Boolean> prepareWaitForIndexing()
        A Future that accepts callback on completion when all the indexing worker are done.
        Since:
        7.2
      • refresh

        void refresh()
        Refresh all document indexes, immediately after the operation occurs, so that the updated document appears in search results immediately. There is no fsync thus doesn't guarantee durability.
        Since:
        5.9.3
      • refreshRepositoryIndex

        void refreshRepositoryIndex​(String repositoryName)
        Refresh document index for the specific repository, immediately after the operation occurs, so that the updated document appears in search results immediately. There is no fsync thus doesn't guarantee durability.
        Since:
        5.9.4
      • flush

        void flush()
        Elasticsearch flush on all document indexes, triggers a lucene commit, empties the transaction log. Data is flushed to disk.
        Since:
        5.9.3
      • flushRepositoryIndex

        void flushRepositoryIndex​(String repositoryName)
        Elasticsearch flush on document index for a specific repository, triggers a lucene commit, empties the transaction log. Data is flushed to disk.
        Since:
        5.9.4
      • optimizeRepositoryIndex

        void optimizeRepositoryIndex​(String repositoryName)
        Elasticsearch optimize operation allows to reduce the number of segments to one, Note that this can potentially be a very heavy operation.
        Since:
        7.2
      • optimizeIndex

        void optimizeIndex​(String indexName)
        Elasticsearch optimize operation allows to reduce the number of segments to one, Note that this can potentially be a very heavy operation.
        Since:
        7.3
      • getPendingWorkerCount

        long getPendingWorkerCount()
        Returns the number of indexing worker scheduled waiting to be executed.
        Since:
        7.1
      • getRunningWorkerCount

        long getRunningWorkerCount()
        Returns the number of indexing worker that are currently running.
        Since:
        7.1
      • getTotalCommandProcessed

        int getTotalCommandProcessed()
        Returns the total number of command processed by Elasticsearch for this Nuxeo instance. Useful for test assertion.
        Since:
        5.9.4
      • isEmbedded

        boolean isEmbedded()
        Returns true if the Elasticsearch is embedded with Nuxeo, sharing the same JVM.
        Since:
        7.2
      • useExternalVersion

        boolean useExternalVersion()
        When true use an external version for Elasticsearch document, this enable an optimistic concurrency control ensuring that an older version of a document never overwrites a newer version.
        Since:
        8.3