## org.apache.lucene.demo
Class SearchFiles

    java.lang.Object
      org.apache.lucene.demo.SearchFiles

    public class SearchFiles

extends java.lang.Object

Simple command-line based search demo.

Method Summary
`static void` `doPagingSearch(java.io.BufferedReader in, org.apache.lucene.search.Searcher searcher, org.apache.lucene.search.Query query, int hitsPerPage, boolean raw, boolean interactive)` This demonstrates a typical paging search scenario, where the search engine presents pages of size n to the user.
`static void` `doStreamingSearch(org.apache.lucene.search.Searcher searcher, org.apache.lucene.search.Query query)` This method uses a custom HitCollector implementation which simply prints out the docId and score of every matching document.
`static void` `main(java.lang.String[] args)` Simple command-line based search demo.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### main

    public static void main(java.lang.String[] args)
                     throws java.lang.Exception

  Simple command-line based search demo.

  Throws:
    `java.lang.Exception`

### doStreamingSearch

    public static void doStreamingSearch(org.apache.lucene.search.Searcher searcher,
                                         org.apache.lucene.search.Query query)
                                  throws java.io.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.

  Throws:
    `java.io.IOException`

### doPagingSearch

    public static void doPagingSearch(java.io.BufferedReader in,
                                      org.apache.lucene.search.Searcher searcher,
                                      org.apache.lucene.search.Query query,
                                      int hitsPerPage,
                                      boolean raw,
                                      boolean interactive)
                               throws java.io.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.

  Throws:
    `java.io.IOException`

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.