Class AbstractSearch

    • Field Detail

      • indices

        protected final List<Index> indices
      • startOffset

        protected final int startOffset
      • limit

        protected final int limit
      • searchAfter

        protected final List<String> searchAfter
    • Constructor Detail

      • AbstractSearch

        protected AbstractSearch​(EnumSet<SearchIndex> indexes,
                                 @NonNull SearchQuery query,
                                 SearchSort sort)
        Constructs an abstract representation of a search to be performed. The maximum number of results returned will be a system provided default.
        Parameters:
        indexes - the non-empty, non-null set of indexes which will be searched
        query - the non-null query to perform on the indexes
        sort - how to order the results of the query
      • AbstractSearch

        @Deprecated(since="8.7.0",
                    forRemoval=true)
        protected AbstractSearch​(EnumSet<SearchIndex> indexes,
                                 @NonNull SearchQuery query,
                                 SearchSort sort,
                                 int startOffset,
                                 int limit)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Constructs an abstract representation of a search to be performed.
        Parameters:
        indexes - the indexes which will be searched, non-empty.
        query - the query to perform on the indexes non-null.
        sort - how to order the results of the query
        startOffset - the zero-based offset of the first result to return
        limit - the maximum number of results to return
    • Method Detail

      • getQuery

        public @NonNull SearchQuery getQuery()
        Gets the query component of the search
        Specified by:
        getQuery in interface ISearch
        Returns:
        the non-null search query
      • getSort

        public SearchSort getSort()
        Gets the sort component of the search
        Specified by:
        getSort in interface ISearch
        Returns:
        the search sort
      • getStartOffset

        public int getStartOffset()
        Specified by:
        getStartOffset in interface ISearch
        Returns:
        the start offset (0 based).
      • getLimit

        public int getLimit()
        Specified by:
        getLimit in interface ISearch
        Returns:
        the maximum page size (positive).
      • getSearchIndexes

        public EnumSet<SearchIndex> getSearchIndexes()
        Description copied from interface: ISearch
        IMPORTANT: Use the new getIndices method instead. Specifies which indexes should be targeted for this particular search.
        Specified by:
        getSearchIndexes in interface ISearch
      • getIndices

        public List<Index> getIndices()
        Specified by:
        getIndices in interface ISearch
        Returns:
        a list of indexes should be targeted
      • getSearchAfter

        public List<String> getSearchAfter()
        Description copied from interface: ISearch
        This method is only relevant to OpenSearch. It does not have any effect if querying against Lucene.
        Specified by:
        getSearchAfter in interface ISearch
        Returns:
        a list of sorted field values
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object