add missing javadocs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1440829 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-01-31 03:06:47 +00:00
parent c1024f192e
commit f21ce95241
16 changed files with 93 additions and 8 deletions

View File

@ -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;

View File

@ -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());

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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 {

View File

@ -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
{

View File

@ -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());
}

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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();

View File

@ -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.

View File

@ -28,6 +28,9 @@ import org.apache.lucene.facet.taxonomy.CategoryPath;
* @lucene.experimental
*/
public class SimpleUtils {
/** No instance */
private SimpleUtils() {}
/**
* Documents text field.

View File

@ -36,6 +36,7 @@ import org.apache.lucene.util.Version;
*/
/**
* Utility methods for merging index and taxonomy directories.
* @lucene.experimental
*/
public class TaxonomyMergeUtils {