mirror of https://github.com/apache/lucene.git
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:
parent
874355b954
commit
c80542ffaf
|
@ -45,7 +45,7 @@ public class IndexFiles {
|
||||||
|
|
||||||
/** Index all text files under a directory. */
|
/** Index all text files under a directory. */
|
||||||
public static void main(String[] args) {
|
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"
|
+ " [-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...)
|
// 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.";
|
+ "See http://lucene.apache.org/java/4_0/demo.html for details.";
|
||||||
|
|
|
@ -189,7 +189,7 @@ public class SearchFiles {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!interactive) {
|
if (!interactive || end == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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:
|
you've set your CLASSPATH correctly, just type:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
java org.apache.lucene.demo.IndexFiles {full-path-to-lucene}/src
|
java org.apache.lucene.demo.IndexFiles -docs {path-to-lucene}/src
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
This will produce a subdirectory called <code>index</code> which will contain an index of all of the
|
This will produce a subdirectory called <code>index</code> which will contain an index of all of the
|
||||||
|
|
|
@ -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
|
<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
|
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>
|
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>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<p>
|
||||||
<li>Streaming: A <a href="api/core/org/apache/lucene/search/Collector.html">Collector</a> subclass
|
<code>SearchFiles</code> uses the <code>IndexSearcher.search(query,n)</code> method that returns
|
||||||
simply prints out the document ID and score for each matching document.</li>
|
<a href="api/core/org/apache/lucene/search/TopDocs.html">TopDocs</a> with max <code>n</code> hits.
|
||||||
<li>Paging: Using the <code>IndexSearcher.search(query,n)</code> method that returns
|
The results are printed in pages, sorted by score (i.e. relevance).
|
||||||
<a href="api/core/org/apache/lucene/search/TopDocs.html">TopDocs</a> with max <code>n</code> hits,
|
</p>
|
||||||
the search results are printed in pages, sorted by score (i.e. relevance).</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</document>
|
</document>
|
||||||
|
|
Loading…
Reference in New Issue