Skip to content

Apache Lucene open-source search software

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

Steven Rowec80542ffaf01
diff --git a/lucene/contrib/demo/src/java/org/apache/lucene/demo/IndexFiles.java b/lucene/contrib/demo/src/java/org/apache/lucene/demo/IndexFiles.java
index 6ac4bec4de5..430e1f191b0 100644
--- a/lucene/contrib/demo/src/java/org/apache/lucene/demo/IndexFiles.java
+++ b/lucene/contrib/demo/src/java/org/apache/lucene/demo/IndexFiles.java
@@ -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.";
diff --git a/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java b/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java
index 4a24e607c34..7d1e9292aad 100644
--- a/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java
+++ b/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java
@@ -189,7 +189,7 @@ public class SearchFiles {
}
- if (!interactive) {
+ if (!interactive || end == 0) {
break;
}
diff --git a/lucene/src/site/src/documentation/content/xdocs/demo.xml b/lucene/src/site/src/documentation/content/xdocs/demo.xml
index 1d0851abe9c..34db83a21b4 100644
--- a/lucene/src/site/src/documentation/content/xdocs/demo.xml
+++ b/lucene/src/site/src/documentation/content/xdocs/demo.xml
@@ -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
diff --git a/lucene/src/site/src/documentation/content/xdocs/demo2.xml b/lucene/src/site/src/documentation/content/xdocs/demo2.xml
index cebc17720a5..955f54ce60b 100644
--- a/lucene/src/site/src/documentation/content/xdocs/demo2.xml
+++ b/lucene/src/site/src/documentation/content/xdocs/demo2.xml
@@ -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>