Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

add missing javadocs

Robert Muirf21ce95241a3
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleResult.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleResult.java
index 0f08353db0e..e0d3abd54e4 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleResult.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleResult.java
@@ -29,18 +29,21 @@ import org.apache.lucene.facet.search.results.FacetResult;
* @lucene.experimental
*/
public class ExampleResult {
+
+ /** Sole constructor. */
+ public ExampleResult() {}
private List<FacetResult> facetResults;
/**
- * @return the facet results
+ * Returns the facet results
*/
public List<FacetResult> getFacetResults() {
return facetResults;
}
/**
- * @param facetResults the facet results to set
+ * Sets the facet results
*/
public void setFacetResults(List<FacetResult> facetResults) {
this.facetResults = facetResults;
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleUtils.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleUtils.java
index 4f788956b05..7a5fa7057f6 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleUtils.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleUtils.java
@@ -20,15 +20,28 @@ import org.apache.lucene.util.Version;
*/
/**
+ * Simple utility functions for the faceting examples
* @lucene.experimental
*/
public class ExampleUtils {
+
+ /** No instance */
+ private ExampleUtils() {}
+ /**
+ * True if the system property <code>tests.verbose</code> has been set.
+ * If true, it causes {@link #log(Object)} to print messages to the console.
+ */
public static final boolean VERBOSE = Boolean.getBoolean("tests.verbose");
/** The Lucene {@link Version} used by the example code. */
public static final Version EXAMPLE_VER = Version.LUCENE_40;
+ /**
+ * Logs the String representation of <code>msg</code> to the console,
+ * if {@link #VERBOSE} is true. Otherwise, does nothing.
+ * @see #VERBOSE
+ */
public static void log(Object msg) {
if (VERBOSE) {
System.out.println(msg.toString());
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveMain.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveMain.java
index 75704ea1a76..994d03f867e 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveMain.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveMain.java
@@ -36,6 +36,9 @@ import org.apache.lucene.facet.search.results.FacetResult;
* @lucene.experimental
*/
public class AdaptiveMain {
+
+ /** Sole constructor */
+ public AdaptiveMain() {}
/**
* Driver for the adaptive sample.
@@ -46,6 +49,7 @@ public class AdaptiveMain {
ExampleUtils.log("DONE");
}
+ /** Runs the adaptive sample and returns the facet results */
public ExampleResult runSample() throws Exception {
// create Directories for the search index and for the taxonomy index
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveSearcher.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveSearcher.java
index 7f79192e091..4859035263f 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveSearcher.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveSearcher.java
@@ -46,6 +46,9 @@ import org.apache.lucene.store.Directory;
*/
public class AdaptiveSearcher {
+ /** No instance */
+ private AdaptiveSearcher() {}
+
/**
* Search with facets through the {@link AdaptiveFacetsAccumulator}
* @param indexDir Directory of the search index.
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsIndexer.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsIndexer.java
index c0b2127b06e..1ae9ff95579 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsIndexer.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsIndexer.java
@@ -40,6 +40,9 @@ import org.apache.lucene.store.Directory;
* @lucene.experimental
*/
public class CategoryAssociationsIndexer {
+
+ /** No instance. */
+ private CategoryAssociationsIndexer() {}
/**
* Create an index, and adds to it sample documents and categories.
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsMain.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsMain.java
index ca34e46c87c..2a80951be83 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsMain.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsMain.java
@@ -33,6 +33,9 @@ import org.apache.lucene.facet.search.results.FacetResult;
*/
public class CategoryAssociationsMain {
+ /** Sole constructor. */
+ public CategoryAssociationsMain() {}
+
/**
* Driver for the simple sample.
* @throws Exception on error (no detailed exception handling here for sample simplicity
@@ -43,6 +46,9 @@ public class CategoryAssociationsMain {
ExampleUtils.log("DONE");
}
+ /**
+ * Runs the example demonstrating sum of int-association.
+ */
public ExampleResult runSumIntAssociationSample() throws Exception {
// create Directories for the search index and for the taxonomy index
@@ -61,6 +67,9 @@ public class CategoryAssociationsMain {
return res;
}
+ /**
+ * Runs the example demonstrating sum of float-association.
+ */
public ExampleResult runSumFloatAssociationSample() throws Exception {
// create Directories for the search index and for the taxonomy index
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsSearcher.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsSearcher.java
index e6d66d5da37..5e6d7ecd925 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsSearcher.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsSearcher.java
@@ -38,6 +38,9 @@ import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
* @lucene.experimental
*/
public class CategoryAssociationsSearcher {
+
+ /** No instantiation */
+ private CategoryAssociationsSearcher() {}
/** Search an index with a sum of int-association. */
public static List<FacetResult> searchSumIntAssociation(Directory indexDir, Directory taxoDir) throws Exception {
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsUtils.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsUtils.java
index a9968f351b9..5db61a6f763 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsUtils.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsUtils.java
@@ -23,9 +23,13 @@ import org.apache.lucene.facet.taxonomy.CategoryPath;
*/
/**
+ * Categories for the facet examples
* @lucene.experimental
*/
public class CategoryAssociationsUtils {
+
+ /** No instance */
+ private CategoryAssociationsUtils() {}
/**
* Categories: categories[D][N] == category-path with association no. N for
@@ -45,6 +49,9 @@ public class CategoryAssociationsUtils {
}
};
+ /**
+ * Associations (occurrences/confidence levels) for {@link #categories}
+ */
public static CategoryAssociation[][] associations = {
// Doc #1 associations
{
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLIndexer.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLIndexer.java
index 27d3d39f4b2..d98d28eddef 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLIndexer.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLIndexer.java
@@ -48,14 +48,17 @@ import org.apache.lucene.store.RAMDirectory;
* @lucene.experimental
*/
public class MultiCLIndexer {
+
+ /** No instance */
+ private MultiCLIndexer() {}
- // Number of documents to index
+ /** Number of documents to index */
public static int NUM_DOCS = 100;
- // Number of facets to add per document
+ /** Number of facets to add per document */
public static int NUM_FACETS_PER_DOC = 10;
- // Number of tokens in title
+ /** Number of tokens in title */
public static int TITLE_LENGTH = 5;
- // Number of tokens in text
+ /** Number of tokens in text */
public static int TEXT_LENGTH = 100;
// Lorum ipsum to use as content - this will be tokenized and used for document
@@ -73,7 +76,7 @@ public class MultiCLIndexer {
+ "nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure"
+ "reprehenderit qui in ea voluptate velit esse quam nihil molestiae "
+ "consequatur vel illum qui dolorem eum fugiat quo voluptas nulla pariatur";
- // PerDimensionIndexingParams for multiple category lists
+ /** PerDimensionIndexingParams for multiple category lists */
public static final PerDimensionIndexingParams MULTI_IPARAMS;
// Initialize PerDimensionIndexingParams
@@ -199,6 +202,7 @@ public class MultiCLIndexer {
+ nFacetsAdded + " facets.");
}
+ /** Driver for the example */
public static void main(String[] args) throws Exception {
index(new RAMDirectory(), new RAMDirectory());
}
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLMain.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLMain.java
index 73ca28b7746..c82ca1f3185 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLMain.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLMain.java
@@ -27,12 +27,17 @@ import org.apache.lucene.facet.search.results.FacetResult;
*/
/**
+ * Driver for the multi sample.
+ *
* @lucene.experimental
*/
public class MultiCLMain {
+
+ /** Sole constructor. */
+ public MultiCLMain() {}
/**
- * Driver for the multi sample.
+ * Executes the multi sample.
*
* @throws Exception
* on error (no detailed exception handling here for sample
@@ -43,6 +48,7 @@ public class MultiCLMain {
ExampleUtils.log("DONE");
}
+ /** Runs the multi sample and returns the facet results */
public ExampleResult runSample() throws Exception {
// create Directories for the search index and for the taxonomy index
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLSearcher.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLSearcher.java
index b6b63e1c383..e54fb82a3ee 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLSearcher.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLSearcher.java
@@ -49,6 +49,9 @@ import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
* @lucene.experimental
*/
public class MultiCLSearcher {
+
+ /** No instance */
+ private MultiCLSearcher() {}
/**
* Search an index with facets.
@@ -78,6 +81,18 @@ public class MultiCLSearcher {
return results;
}
+ /**
+ * Search an index with facets.
+ *
+ * @param indexReader
+ * Reader over the search index.
+ * @param taxo
+ * taxonomy reader.
+ * @throws Exception
+ * on error (no detailed exception handling here for sample
+ * simplicity
+ * @return facet results
+ */
public static List<FacetResult> searchWithFacets(IndexReader indexReader,
TaxonomyReader taxo, FacetIndexingParams iParams) throws Exception {
// prepare searcher to search against
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleIndexer.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleIndexer.java
index 1473ba4588d..d095aba0298 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleIndexer.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleIndexer.java
@@ -39,6 +39,9 @@ import org.apache.lucene.store.Directory;
* @lucene.experimental
*/
public class SimpleIndexer {
+
+ /** No instance */
+ private SimpleIndexer() {}
/**
* Create an index, and adds to it sample documents and facets.
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleMain.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleMain.java
index 76a6171ba42..22448f8302e 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleMain.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleMain.java
@@ -36,6 +36,9 @@ import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
* @lucene.experimental
*/
public class SimpleMain {
+
+ /** Sole constructor */
+ public SimpleMain() {}
/**
* Driver for the simple sample.
@@ -47,6 +50,7 @@ public class SimpleMain {
ExampleUtils.log("DONE");
}
+ /** Runs the simple sample and returns the facet results */
public ExampleResult runSimple() throws Exception {
// create Directories for the search index and for the taxonomy index
Directory indexDir = new RAMDirectory();
@@ -72,6 +76,7 @@ public class SimpleMain {
return res;
}
+ /** Runs the simple sample and returns drilldown results */
public ExampleResult runDrillDown() throws Exception {
// create Directories for the search index and for the taxonomy index
Directory indexDir = new RAMDirectory();
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleSearcher.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleSearcher.java
index 9cc554068f3..10b14ca66fb 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleSearcher.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleSearcher.java
@@ -47,6 +47,9 @@ import org.apache.lucene.search.TopScoreDocCollector;
*/
public class SimpleSearcher {
+ /** No instance */
+ private SimpleSearcher() {}
+
/**
* Search an index with facets.
* @param indexReader index reader.
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleUtils.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleUtils.java
index 6dd52fbe62d..9170e2df338 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleUtils.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleUtils.java
@@ -28,6 +28,9 @@ import org.apache.lucene.facet.taxonomy.CategoryPath;
* @lucene.experimental
*/
public class SimpleUtils {
+
+ /** No instance */
+ private SimpleUtils() {}
/**
* Documents text field.
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/util/TaxonomyMergeUtils.java b/lucene/facet/src/java/org/apache/lucene/facet/util/TaxonomyMergeUtils.java
index 2e4a74e4c64..0e157bbbe66 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/util/TaxonomyMergeUtils.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/util/TaxonomyMergeUtils.java
@@ -36,6 +36,7 @@ import org.apache.lucene.util.Version;
*/
/**
+ * Utility methods for merging index and taxonomy directories.
* @lucene.experimental
*/
public class TaxonomyMergeUtils {