LUCENE-2923: fixed docs; interactive SearchFiles now directly asks for another query when there are zero results

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1072683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2011-02-20 18:59:07 +00:00
parent 874355b954
commit c80542ffaf
4 changed files with 9 additions and 12 deletions

View File

@ -45,7 +45,7 @@ public class IndexFiles {
/** Index all text files under a directory. */
public static void main(String[] args) {
String usage = "java org.apache.lucene.demo.IndexFiles <root_directory>"
String usage = "java org.apache.lucene.demo.IndexFiles"
+ " [-index INDEX_PATH] [-docs DOCS_PATH] [-update]\n\n"
// TODO: Change the link with every release (or: fill in some less error-prone alternative here...)
+ "See http://lucene.apache.org/java/4_0/demo.html for details.";

View File

@ -189,7 +189,7 @@ public class SearchFiles {
}
if (!interactive) {
if (!interactive || end == 0) {
break;
}

View File

@ -56,7 +56,7 @@ Once you've gotten this far you're probably itching to go. Let's <b>build an in
you've set your CLASSPATH correctly, just type:
<pre>
java org.apache.lucene.demo.IndexFiles {full-path-to-lucene}/src
java org.apache.lucene.demo.IndexFiles -docs {path-to-lucene}/src
</pre>
This will produce a subdirectory called <code>index</code> which will contain an index of all of the

View File

@ -136,17 +136,14 @@ to the searcher. Note that it's also possible to programmatically construct a r
<a href="api/core/org/apache/lucene/search/Query.html">Query</a> object without using the query
parser. The query parser just enables decoding the <a href="queryparsersyntax.html">Lucene query
syntax</a> into the corresponding <a href="api/core/org/apache/lucene/search/Query.html">Query</a>
object. Search can be executed in two different ways:
object.
</p>
<ul>
<li>Streaming: A <a href="api/core/org/apache/lucene/search/Collector.html">Collector</a> subclass
simply prints out the document ID and score for each matching document.</li>
<li>Paging: Using the <code>IndexSearcher.search(query,n)</code> method that returns
<a href="api/core/org/apache/lucene/search/TopDocs.html">TopDocs</a> with max <code>n</code> hits,
the search results are printed in pages, sorted by score (i.e. relevance).</li>
</ul>
<p>
<code>SearchFiles</code> uses the <code>IndexSearcher.search(query,n)</code> method that returns
<a href="api/core/org/apache/lucene/search/TopDocs.html">TopDocs</a> with max <code>n</code> hits.
The results are printed in pages, sorted by score (i.e. relevance).
</p>
</section>
</body>
</document>