Interface SearchService

All Known Implementing Classes:
SearchServiceImpl

public interface SearchService
A Service to search on Nuxeo repositories.
Since:
2025.0
  • Method Details

    • getDefaultRepositoryName

      String getDefaultRepositoryName()
      Gets the default repository name.
    • getRepositoryNames

      Set<String> getRepositoryNames()
      Gets the set of repository names.
    • getDefaultIndexName

      default String getDefaultIndexName()
      Gets the default index for the default repository.
      Since:
      2025.1
    • getDefaultIndexName

      String getDefaultIndexName(String repository)
      Gets the default index for the given repository.
      Since:
      2025.1
    • getIndexNames

      List<String> getIndexNames(String repository)
      Gets all available indexes for a repository.
      Since:
      2025.1
    • getSearchIndex

      SearchIndex getSearchIndex(String indexName)
      Gets the SearchIndex for the given index name.
      Throws:
      NullPointerException - if indexName is unknown.
      Since:
      2025.1
    • getDefaultSearchIndex

      @Deprecated(since="2025.1", forRemoval=true) default SearchIndex getDefaultSearchIndex()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2025.1, use getDefaultIndexName() instead.
      Gets the default SearchIndex for the default repository.
    • getDefaultSearchIndexForRepository

      @Deprecated(since="2025.1", forRemoval=true) SearchIndex getDefaultSearchIndexForRepository(String repository)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2025.1, use getDefaultIndexName(String) instead.
      Gets the default SearchIndex for a given repository.
    • getSearchIndexForRepository

      @Deprecated(since="2025.1", forRemoval=true) List<SearchIndex> getSearchIndexForRepository(String repository)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2025.1, use getIndexNames(String) instead.
      Gets the list of SearchIndex for a given repository.
    • search

      SearchResponse search(SearchQuery query)
      Executes a search query.
      var response = searchService.search(SearchQuery.builder("SELECT * FROM Document", session).build());
      
      Throws:
      QueryParseException - if the NXQL query is invalid
      RetryableException - if search client cannot access the search backend
      SearchClientException - if search client is not able to process the query
    • searchScroll

      SearchResponse searchScroll(SearchScrollContext scrollContext)
      Iterate on results for a scroll search. The end of scroll is reached when there is no more hit, i.e. SearchResponse.getHitsCount() returns 0.
      Parameters:
      scrollContext - provided by the previous SearchResponse.getScrollContext();
    • clearSearchScroll

      boolean clearSearchScroll(SearchScrollContext scrollContext)
      Explicit clear the search scroll context, without waiting for the scroll keep alive to timeout.
      Returns:
      true if the context is successfully cleared.