rename FacetIndexingParams.ALL_PARENTS to DEFAULT

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1445341 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2013-02-12 20:30:06 +00:00
parent 30e15a01c1
commit 3f8993715b
8 changed files with 19 additions and 19 deletions

View File

@ -54,7 +54,7 @@ public class AssociationsFacetFields extends FacetFields {
} }
/** /**
* Constructs a new instance with the {@link FacetIndexingParams#ALL_PARENTS * Constructs a new instance with the {@link FacetIndexingParams#DEFAULT
* default} facet indexing params. * default} facet indexing params.
* *
* @param taxonomyWriter * @param taxonomyWriter

View File

@ -49,9 +49,9 @@ public class Facet42Codec extends Lucene42Codec {
private final DocValuesFormat lucene42DVFormat = DocValuesFormat.forName("Lucene42"); private final DocValuesFormat lucene42DVFormat = DocValuesFormat.forName("Lucene42");
// must have that for SPI purposes // must have that for SPI purposes
/** Default constructor, uses {@link FacetIndexingParams#ALL_PARENTS}. */ /** Default constructor, uses {@link FacetIndexingParams#DEFAULT}. */
public Facet42Codec() { public Facet42Codec() {
this(FacetIndexingParams.ALL_PARENTS); this(FacetIndexingParams.DEFAULT);
} }
/** /**

View File

@ -74,14 +74,14 @@ public class FacetFields {
protected final FacetIndexingParams indexingParams; protected final FacetIndexingParams indexingParams;
/** /**
* Constructs a new instance with the {@link FacetIndexingParams#ALL_PARENTS * Constructs a new instance with the {@link FacetIndexingParams#DEFAULT
* default} facet indexing params. * default} facet indexing params.
* *
* @param taxonomyWriter * @param taxonomyWriter
* used to resolve given categories to ordinals * used to resolve given categories to ordinals
*/ */
public FacetFields(TaxonomyWriter taxonomyWriter) { public FacetFields(TaxonomyWriter taxonomyWriter) {
this(taxonomyWriter, FacetIndexingParams.ALL_PARENTS); this(taxonomyWriter, FacetIndexingParams.DEFAULT);
} }
/** /**

View File

@ -3,7 +3,6 @@ package org.apache.lucene.facet.params;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
import org.apache.lucene.facet.search.FacetArrays; import org.apache.lucene.facet.search.FacetArrays;
import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.facet.taxonomy.CategoryPath;
@ -47,9 +46,10 @@ public class FacetIndexingParams {
/** /**
* A {@link FacetIndexingParams} which fixes a single * A {@link FacetIndexingParams} which fixes a single
* {@link CategoryListParams} with {@link OrdinalPolicy#ALL_PARENTS}. * {@link CategoryListParams} with
* {@link CategoryListParams#DEFAULT_ORDINAL_POLICY}.
*/ */
public static final FacetIndexingParams ALL_PARENTS = new FacetIndexingParams(); public static final FacetIndexingParams DEFAULT = new FacetIndexingParams();
/** /**
* The default delimiter with which {@link CategoryPath#components} are * The default delimiter with which {@link CategoryPath#components} are
@ -67,7 +67,7 @@ public class FacetIndexingParams {
/** /**
* Initializes new default params. You should use this constructor only if you * Initializes new default params. You should use this constructor only if you
* intend to override any of the getters, otherwise you can use * intend to override any of the getters, otherwise you can use
* {@link #ALL_PARENTS} to save unnecessary object allocations. * {@link #DEFAULT} to save unnecessary object allocations.
*/ */
public FacetIndexingParams() { public FacetIndexingParams() {
this(DEFAULT_CATEGORY_LIST_PARAMS); this(DEFAULT_CATEGORY_LIST_PARAMS);

View File

@ -40,22 +40,22 @@ public class FacetSearchParams {
/** /**
* Initializes with the given {@link FacetRequest requests} and default * Initializes with the given {@link FacetRequest requests} and default
* {@link FacetIndexingParams#ALL_PARENTS}. If you used a different * {@link FacetIndexingParams#DEFAULT}. If you used a different
* {@link FacetIndexingParams}, you should use * {@link FacetIndexingParams}, you should use
* {@link #FacetSearchParams(FacetIndexingParams, List)}. * {@link #FacetSearchParams(FacetIndexingParams, List)}.
*/ */
public FacetSearchParams(FacetRequest... facetRequests) { public FacetSearchParams(FacetRequest... facetRequests) {
this(FacetIndexingParams.ALL_PARENTS, Arrays.asList(facetRequests)); this(FacetIndexingParams.DEFAULT, Arrays.asList(facetRequests));
} }
/** /**
* Initializes with the given {@link FacetRequest requests} and default * Initializes with the given {@link FacetRequest requests} and default
* {@link FacetIndexingParams#ALL_PARENTS}. If you used a different * {@link FacetIndexingParams#DEFAULT}. If you used a different
* {@link FacetIndexingParams}, you should use * {@link FacetIndexingParams}, you should use
* {@link #FacetSearchParams(FacetIndexingParams, List)}. * {@link #FacetSearchParams(FacetIndexingParams, List)}.
*/ */
public FacetSearchParams(List<FacetRequest> facetRequests) { public FacetSearchParams(List<FacetRequest> facetRequests) {
this(FacetIndexingParams.ALL_PARENTS, facetRequests); this(FacetIndexingParams.DEFAULT, facetRequests);
} }
/** /**

View File

@ -74,7 +74,7 @@ public class OrdinalMappingAtomicReader extends FilterAtomicReader {
* OrdinalMappingAtomicReader(in, ordinalMap, new DefaultFacetIndexingParams())} * OrdinalMappingAtomicReader(in, ordinalMap, new DefaultFacetIndexingParams())}
*/ */
public OrdinalMappingAtomicReader(AtomicReader in, int[] ordinalMap) { public OrdinalMappingAtomicReader(AtomicReader in, int[] ordinalMap) {
this(in, ordinalMap, FacetIndexingParams.ALL_PARENTS); this(in, ordinalMap, FacetIndexingParams.DEFAULT);
} }
/** /**

View File

@ -187,7 +187,7 @@ public class TestTotalFacetCountsCache extends FacetTestCase {
Multi[] multis = new Multi[numThreads]; Multi[] multis = new Multi[numThreads];
for (int i = 0; i < numThreads; i++) { for (int i = 0; i < numThreads; i++) {
multis[i] = new Multi(slowIndexReader, slowTaxoReader, FacetIndexingParams.ALL_PARENTS); multis[i] = new Multi(slowIndexReader, slowTaxoReader, FacetIndexingParams.DEFAULT);
} }
for (Multi m : multis) { for (Multi m : multis) {
@ -234,7 +234,7 @@ public class TestTotalFacetCountsCache extends FacetTestCase {
// Create our index/taxonomy writers // Create our index/taxonomy writers
IndexWriter indexWriter = new IndexWriter(indexDir, newIndexWriterConfig(TEST_VERSION_CURRENT, null)); IndexWriter indexWriter = new IndexWriter(indexDir, newIndexWriterConfig(TEST_VERSION_CURRENT, null));
TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir); TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
FacetIndexingParams iParams = FacetIndexingParams.ALL_PARENTS; FacetIndexingParams iParams = FacetIndexingParams.DEFAULT;
// Add a facet to the index // Add a facet to the index
addFacets(iParams, indexWriter, taxoWriter, "a", "b"); addFacets(iParams, indexWriter, taxoWriter, "a", "b");
@ -385,7 +385,7 @@ public class TestTotalFacetCountsCache extends FacetTestCase {
IndexWriter w = new IndexWriter(indexDir, new IndexWriterConfig( IndexWriter w = new IndexWriter(indexDir, new IndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false))); TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
DirectoryTaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir); DirectoryTaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir);
FacetIndexingParams iParams = FacetIndexingParams.ALL_PARENTS; FacetIndexingParams iParams = FacetIndexingParams.DEFAULT;
// Add documents and facets // Add documents and facets
for (int i = 0; i < 1000; i++) { for (int i = 0; i < 1000; i++) {
addFacets(iParams, w, tw, "facet", Integer.toString(i)); addFacets(iParams, w, tw, "facet", Integer.toString(i));
@ -440,7 +440,7 @@ public class TestTotalFacetCountsCache extends FacetTestCase {
IndexWriter indexWriter2 = new IndexWriter(indexDir2, newIndexWriterConfig(TEST_VERSION_CURRENT, null)); IndexWriter indexWriter2 = new IndexWriter(indexDir2, newIndexWriterConfig(TEST_VERSION_CURRENT, null));
TaxonomyWriter taxoWriter1 = new DirectoryTaxonomyWriter(taxoDir1); TaxonomyWriter taxoWriter1 = new DirectoryTaxonomyWriter(taxoDir1);
TaxonomyWriter taxoWriter2 = new DirectoryTaxonomyWriter(taxoDir2); TaxonomyWriter taxoWriter2 = new DirectoryTaxonomyWriter(taxoDir2);
FacetIndexingParams iParams = FacetIndexingParams.ALL_PARENTS; FacetIndexingParams iParams = FacetIndexingParams.DEFAULT;
// Add a facet to the index // Add a facet to the index
addFacets(iParams, indexWriter1, taxoWriter1, "a", "b"); addFacets(iParams, indexWriter1, taxoWriter1, "a", "b");

View File

@ -30,7 +30,7 @@ public class FacetIndexingParamsTest extends FacetTestCase {
@Test @Test
public void testDefaultSettings() { public void testDefaultSettings() {
FacetIndexingParams dfip = FacetIndexingParams.ALL_PARENTS; FacetIndexingParams dfip = FacetIndexingParams.DEFAULT;
assertNotNull("Missing default category list", dfip.getAllCategoryListParams()); assertNotNull("Missing default category list", dfip.getAllCategoryListParams());
assertEquals("all categories have the same CategoryListParams by default", assertEquals("all categories have the same CategoryListParams by default",
dfip.getCategoryListParams(null), dfip.getCategoryListParams(new CategoryPath("a"))); dfip.getCategoryListParams(null), dfip.getCategoryListParams(new CategoryPath("a")));