Interface SearchIndexingService

All Known Implementing Classes:
SearchServiceImpl

public interface SearchIndexingService
Service responsible for managing search index operations including indexing, reindexing, and refreshing documents. This service is primarily intended for internal usage as document indexing typically occurs automatically.
Since:
2025.0
  • Method Details

    • indexDocuments

      BulkIndexingResponse indexDocuments(BulkIndexingRequest request)
      Internal: Indexes documents according to the specified bulk indexing request.
      Parameters:
      request - the bulk indexing request containing documents to index
      Returns:
      the indexing response with operation details
    • reindexRepository

      String reindexRepository(String repository)
      Internal: Reindexes the entire repository by dropping and recreating all associated search indexes.
      Parameters:
      repository - the repository name
      Returns:
      the bulk command id for the reindexing operation
    • reindexRepository

      String reindexRepository(String repository, List<String> indexNames)
      Internal: Reindexes the entire repository by dropping and recreating the given search indexes.
      Parameters:
      indexNames - the list of indexes to reindex, all indexes must be on the same repository
      Returns:
      the bulk command id for the reindexing operation
      Since:
      2025.11
    • reindexDocuments

      default String reindexDocuments(String repository, String nxql)
      Reindexes documents matching the specified NXQL query for all search indexes in the repository.
      Parameters:
      repository - the repository name
      nxql - the NXQL query to select documents
      Returns:
      the bulk command id for the reindexing operation
    • reindexDocuments

      String reindexDocuments(String repository, String nxql, long queryLimit)
      Reindexes documents matching the specified NXQL query up to the given limit for all search indexes of the repository.
      Parameters:
      repository - the repository name
      nxql - the NXQL query to select documents
      queryLimit - maximum number of documents to index, or -1 for no limit
      Returns:
      the bulk command id for the reindexing operation
      Since:
      2025.8
    • reindexDocuments

      String reindexDocuments(String repository, String nxql, long queryLimit, List<String> indexNames)
      Reindexes documents matching the specified NXQL query for the given limit only for the specified indexes.
      Parameters:
      repository - the repository name
      nxql - the NXQL query to select documents
      queryLimit - maximum number of documents to index, or -1 for no limit
      indexNames - search indexes to reindex, all search indexes must point to the same repository
      Returns:
      the bulk command id for the reindexing operation
      Since:
      2025.11
    • refresh

      void refresh(SearchIndex index)
      Refreshes a search index to make newly indexed documents immediately searchable.
      Parameters:
      index - the search index to refresh
    • getClient

      SearchClient getClient(String clientName)
      Internal: Retrieves a search client by name.
      Parameters:
      clientName - the name of the search client
      Returns:
      the search client instance
    • await

      boolean await(Duration duration) throws InterruptedException
      Waits for completion of all indexing activities. Intended for testing purposes only.
      Parameters:
      duration - the maximum duration to wait
      Returns:
      true if all indexing operations completed, false if timeout occurred
      Throws:
      InterruptedException - if the current thread is interrupted while waiting