Class LuceneSearchQueryImpl<H>

    • Method Detail

      • queryString

        public String queryString()
        Specified by:
        queryString in interface SearchQuery<H>
        Returns:
        A textual representation of the query.
      • extension

        public <Q> Q extension​(SearchQueryExtension<Q,​H> extension)
        Description copied from interface: SearchQuery
        Extend the current query with the given extension, resulting in an extended query offering more options or a more detailed result type.
        Specified by:
        extension in interface SearchQuery<H>
        Type Parameters:
        Q - The type of queries provided by the extension.
        Parameters:
        extension - The extension to the predicate DSL.
        Returns:
        The extended query.
      • fetchHits

        public List<H> fetchHits​(Integer offset,
                                 Integer limit)
        Description copied from interface: SearchFetchable
        Execute the query and return the hits as a List, skipping offset hits and limiting to limit hits.
        Specified by:
        fetchHits in interface SearchFetchable<H>
        Parameters:
        offset - The number of hits to skip. null means no offset.
        limit - The maximum number of hits to be returned by this method. null means no limit.
        Returns:
        The query hits.
      • fetchTotalHitCount

        public long fetchTotalHitCount()
        Description copied from interface: SearchFetchable
        Execute the query and return the total hit count.
        Specified by:
        fetchTotalHitCount in interface SearchFetchable<H>
        Returns:
        The total number of matching entities, ignoring pagination settings.
      • explain

        public org.apache.lucene.search.Explanation explain​(Object id)
        Description copied from interface: LuceneSearchQuery
        Explain score computation of this query for the document with the given id.

        This is a shorthand for LuceneSearchQuery.explain(String, Object) when the query only targets one mapped type.

        Specified by:
        explain in interface LuceneSearchQuery<H>
        Parameters:
        id - The id of the entity whose score should be explained. This is the entity ID, which may be of any type (long, ...), not the document ID which is always a string.
        Returns:
        An Explanation describing the score computation for the hit.
      • explain

        public org.apache.lucene.search.Explanation explain​(String typeName,
                                                            Object id)
        Description copied from interface: LuceneSearchQuery
        Explain score computation of this query for the document with the given id in the given mapped type.

        This feature is relatively expensive, use it only sparingly and when you need to debug a slow query.

        Specified by:
        explain in interface LuceneSearchQuery<H>
        Parameters:
        typeName - The name of the type of the entity whose score should be explained.
        id - The id of the entity whose score should be explained. This is the entity ID, which may be of any type (long, ...), not the document ID which is always a string.
        Returns:
        An Explanation describing the score computation for the hit.
      • luceneSort

        public org.apache.lucene.search.Sort luceneSort()
        Specified by:
        luceneSort in interface LuceneSearchQuery<H>
        Returns:
        The Lucene Sort this query relies on.