lux.search
Class LuxSearcher

java.lang.Object
  extended by org.apache.lucene.search.IndexSearcher
      extended by lux.search.LuxSearcher

public class LuxSearcher
extends org.apache.lucene.search.IndexSearcher


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.search.IndexSearcher
org.apache.lucene.search.IndexSearcher.LeafSlice
 
Field Summary
 
Fields inherited from class org.apache.lucene.search.IndexSearcher
leafContexts, leafSlices, readerContext
 
Constructor Summary
LuxSearcher(org.apache.lucene.store.Directory dir)
          creates a Lux searcher that searches the given Directory.
LuxSearcher(org.apache.lucene.index.IndexReader reader)
          The reader will be managed by this LuxSearcher: when the searcher is closed, it will close the underlying reader, unlike in the other constructors, where the reader is expected to be managed externally.
LuxSearcher(org.apache.lucene.search.IndexSearcher searcher)
          creates a Lux searcher based on an existing Lucene IndexSearcher
 
Method Summary
 void close()
           
 org.apache.lucene.search.DocIdSetIterator search(org.apache.lucene.search.Query query)
           
 org.apache.lucene.search.DocIdSetIterator search(org.apache.lucene.search.Query query, org.apache.lucene.search.Sort sort)
           
 org.apache.lucene.search.DocIdSetIterator searchOrdered(org.apache.lucene.search.Query query)
           
 
Methods inherited from class org.apache.lucene.search.IndexSearcher
collectionStatistics, createNormalizedWeight, doc, doc, doc, document, explain, explain, getDefaultSimilarity, getIndexReader, getSimilarity, getTopReaderContext, rewrite, search, search, search, search, search, search, search, search, search, search, search, search, search, searchAfter, searchAfter, searchAfter, searchAfter, searchAfter, setSimilarity, slices, termStatistics, toString, wrapFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LuxSearcher

public LuxSearcher(org.apache.lucene.store.Directory dir)
            throws IOException
creates a Lux searcher that searches the given Directory.

Parameters:
dir - the Directory containing the index to search
Throws:
IOException - if the Directory cannot be opened

LuxSearcher

public LuxSearcher(org.apache.lucene.search.IndexSearcher searcher)
creates a Lux searcher based on an existing Lucene IndexSearcher

Parameters:
searcher - the underlying IndexSearcher

LuxSearcher

public LuxSearcher(org.apache.lucene.index.IndexReader reader)
The reader will be managed by this LuxSearcher: when the searcher is closed, it will close the underlying reader, unlike in the other constructors, where the reader is expected to be managed externally.

Parameters:
reader -
Method Detail

close

public void close()
           throws IOException
Throws:
IOException

search

public org.apache.lucene.search.DocIdSetIterator search(org.apache.lucene.search.Query query)
                                                 throws IOException
Parameters:
query - the Lucene query
Returns:
the unordered results of the query as a Lucene DocIdSetIterator. Unordered means the order is not predictable and may change with subsequent calls.
Throws:
IOException

search

public org.apache.lucene.search.DocIdSetIterator search(org.apache.lucene.search.Query query,
                                                        org.apache.lucene.search.Sort sort)
                                                 throws IOException
Parameters:
query - the Lucene query
sort - the sort criteria
Returns:
the results of the query as a Lucene DocIdSetIterator, ordered using the sort criterion. Results are returned in batches, so deep paging is possible, but expensive.
Throws:
IOException

searchOrdered

public org.apache.lucene.search.DocIdSetIterator searchOrdered(org.apache.lucene.search.Query query)
                                                        throws IOException
Parameters:
query - the Lucene query
Returns:
the results of the query as a Lucene DocIdSetIterator in docID order
Throws:
IOException


Copyright © 2013. All Rights Reserved.