Home » lucene-3.0.1 » org.apache » lucene » demo » [javadoc | source]
public class: SearchFiles [javadoc | source]
Simple command-line based search demo.
Method from org.apache.lucene.demo.SearchFiles Summary:
doPagingSearch,   doStreamingSearch,   main
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.demo.SearchFiles Detail:
 public static  void doPagingSearch(BufferedReader in,
    Searcher searcher,
    Query query,
    int hitsPerPage,
    boolean raw,
    boolean interactive) throws IOException 
    This demonstrates a typical paging search scenario, where the search engine presents pages of size n to the user. The user can then go to the next page if interested in the next hits. When the query is executed for the first time, then only enough results are collected to fill 5 result pages. If the user wants to page beyond this limit, then the query is executed another time and all hits are collected.
 public static  void doStreamingSearch(Searcher searcher,
    Query query) throws IOException 
    This method uses a custom HitCollector implementation which simply prints out the docId and score of every matching document. This simulates the streaming search use case, where all hits are supposed to be processed, regardless of their relevance.
 public static  void main(String[] args) throws Exception 
    Simple command-line based search demo.