Documentation of 'org.apache.lucene.search.Searchable' Java class
Searchable
org.apache.lucene.search

Interface Searchable

  • All Superinterfaces:
    java.rmi.Remote
    All Known Implementing Classes:
    IndexSearcher, MultiSearcher, ParallelMultiSearcher, RemoteSearchable, Searcher


    public interface Searchable
    extends java.rmi.Remote
    The interface for search implementations.

    Searchable is the abstract network protocol for searching. Implementations provide search over a single index, over multiple indices, and over indices on remote servers.

    Queries, filters and sort criteria are designed to be compact so that they may be efficiently passed to a remote index, with only the top-scoring hits being returned, rather than every non-zero scoring hit.

    • Method Detail

      • search

        void search(Weight weight,
                    Filter filter,
                    HitCollector results)
             throws java.io.IOException
        Lower-level search API.

        HitCollector.collect(int,float) is called for every non-zero scoring document.
        HitCollector-based access to remote indexes is discouraged.

        Applications should only use this if they need all of the matching documents. The high-level search API (Searcher.search(Query)) is usually more efficient, as it skips non-high-scoring hits.

        Parameters:
        weight - to match documents
        filter - if non-null, a bitset used to eliminate some documents
        results - to receive hits
        Throws:
        BooleanQuery.TooManyClauses
        java.io.IOException
      • close

        void close()
            throws java.io.IOException
        Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects like Hits.
        Throws:
        java.io.IOException
      • docFreq

        int docFreq(Term term)
             throws java.io.IOException
        Expert: Returns the number of documents containing term. Called by search code to compute term weights.
        Throws:
        java.io.IOException
        See Also:
        IndexReader.docFreq(Term)
      • docFreqs

        int[] docFreqs(Term[] terms)
                throws java.io.IOException
        Expert: For each term in the terms array, calculates the number of documents containing term. Returns an array with these document frequencies. Used to minimize number of remote calls.
        Throws:
        java.io.IOException
      • maxDoc

        int maxDoc()
            throws java.io.IOException
        Expert: Returns one greater than the largest possible document number. Called by search code to compute term weights.
        Throws:
        java.io.IOException
        See Also:
        IndexReader.maxDoc()
      • explain

        Explanation explain(Weight weight,
                            int doc)
                     throws java.io.IOException
        Expert: low-level implementation method Returns an Explanation that describes how doc scored against weight.

        This is intended to be used in developing Similarity implementations, and, for good performance, should not be displayed with every hit. Computing an explanation is as expensive as executing the query over the entire index.

        Applications should call Searcher.explain(Query, int).

        Throws:
        BooleanQuery.TooManyClauses
        java.io.IOException

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.