diff --git a/src/demo/org/apache/lucene/demo/DeleteFiles.java b/src/demo/org/apache/lucene/demo/DeleteFiles.java index 3345c21c624..1e04a403def 100644 --- a/src/demo/org/apache/lucene/demo/DeleteFiles.java +++ b/src/demo/org/apache/lucene/demo/DeleteFiles.java @@ -22,8 +22,13 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; //import org.apache.lucene.index.Term; -class DeleteFiles { + +/** Deletes documents from an index that do not contain a term. */ +public class DeleteFiles { + private DeleteFiles() {} // singleton + + /** Deletes documents from an index that do not contain a term. */ public static void main(String[] args) { String usage = "java org.apache.lucene.demo.DeleteFiles "; if (args.length == 0) { diff --git a/src/demo/org/apache/lucene/demo/IndexFiles.java b/src/demo/org/apache/lucene/demo/IndexFiles.java index 1a15fd56d43..7cdd861235a 100644 --- a/src/demo/org/apache/lucene/demo/IndexFiles.java +++ b/src/demo/org/apache/lucene/demo/IndexFiles.java @@ -24,10 +24,14 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.Date; -class IndexFiles { +/** Index all text files under a directory. */ +public class IndexFiles { + private IndexFiles() {} + static final File INDEX_DIR = new File("index"); + /** Index all text files under a directory. */ public static void main(String[] args) { String usage = "java org.apache.lucene.demo.IndexFiles "; if (args.length == 0) { @@ -64,7 +68,7 @@ class IndexFiles { } } - public static void indexDocs(IndexWriter writer, File file) + static void indexDocs(IndexWriter writer, File file) throws IOException { // do not try to index files that cannot be read if (file.canRead()) { diff --git a/src/demo/org/apache/lucene/demo/IndexHTML.java b/src/demo/org/apache/lucene/demo/IndexHTML.java index be862fb3c87..ff3b15034d4 100644 --- a/src/demo/org/apache/lucene/demo/IndexHTML.java +++ b/src/demo/org/apache/lucene/demo/IndexHTML.java @@ -26,13 +26,16 @@ import java.io.File; import java.util.Date; import java.util.Arrays; -class IndexHTML { +/** Indexer for HTML files. */ +public class IndexHTML { + private IndexHTML() {} private static boolean deleting = false; // true during deletion pass private static IndexReader reader; // existing index private static IndexWriter writer; // new index being built private static TermEnum uidIter; // document id iterator + /** Indexer for HTML files.*/ public static void main(String[] argv) { try { String index = "index"; diff --git a/src/demo/org/apache/lucene/demo/SearchFiles.java b/src/demo/org/apache/lucene/demo/SearchFiles.java index ce9ad9e43fe..f9c92935031 100644 --- a/src/demo/org/apache/lucene/demo/SearchFiles.java +++ b/src/demo/org/apache/lucene/demo/SearchFiles.java @@ -33,7 +33,8 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.Hits; import org.apache.lucene.queryParser.QueryParser; -class SearchFiles { +/** Simple command-line based search demo. */ +public class SearchFiles { /** Use the norms from one field for all fields. Norms are read into memory, * using a byte of memory per document per searched field. This can cause @@ -53,6 +54,9 @@ class SearchFiles { } } + private SearchFiles() {} + + /** Simple command-line based search demo. */ public static void main(String[] args) throws Exception { String usage = "Usage: java org.apache.lucene.demo.SearchFiles [-index dir] [-field f] [-repeat n] [-queries file] [-raw] [-norms field]";