Skip to content

Apache Lucene open-source search software

rename FacetIndexingParams.ALL_PARENTS to DEFAULT

Shai Erera3f8993715bac
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsFacetFields.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsFacetFields.java
index f2c06a3d2f1..87bfac56e50 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsFacetFields.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsFacetFields.java
@@ -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.
*
* @param taxonomyWriter
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/codecs/facet42/Facet42Codec.java b/lucene/facet/src/java/org/apache/lucene/facet/codecs/facet42/Facet42Codec.java
index cfae0aeef99..4987062afc0 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/codecs/facet42/Facet42Codec.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/codecs/facet42/Facet42Codec.java
@@ -49,9 +49,9 @@ public class Facet42Codec extends Lucene42Codec {
private final DocValuesFormat lucene42DVFormat = DocValuesFormat.forName("Lucene42");
// must have that for SPI purposes
- /** Default constructor, uses {@link FacetIndexingParams#ALL_PARENTS}. */
+ /** Default constructor, uses {@link FacetIndexingParams#DEFAULT}. */
public Facet42Codec() {
- this(FacetIndexingParams.ALL_PARENTS);
+ this(FacetIndexingParams.DEFAULT);
}
/**
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/FacetFields.java b/lucene/facet/src/java/org/apache/lucene/facet/index/FacetFields.java
index 6251116894e..facc4b0c58b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/FacetFields.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/index/FacetFields.java
@@ -74,14 +74,14 @@ public class FacetFields {
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.
*
* @param taxonomyWriter
* used to resolve given categories to ordinals
*/
public FacetFields(TaxonomyWriter taxonomyWriter) {
- this(taxonomyWriter, FacetIndexingParams.ALL_PARENTS);
+ this(taxonomyWriter, FacetIndexingParams.DEFAULT);
}
/**
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/params/FacetIndexingParams.java b/lucene/facet/src/java/org/apache/lucene/facet/params/FacetIndexingParams.java
index edd8ef97904..ed269f8fd23 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/params/FacetIndexingParams.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/params/FacetIndexingParams.java
@@ -3,7 +3,6 @@ package org.apache.lucene.facet.params;
import java.util.Collections;
import java.util.List;
-import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
import org.apache.lucene.facet.search.FacetArrays;
import org.apache.lucene.facet.taxonomy.CategoryPath;
@@ -47,9 +46,10 @@ public class FacetIndexingParams {
/**
* 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
@@ -67,7 +67,7 @@ public class FacetIndexingParams {
/**
* Initializes new default params. You should use this constructor only if you
* 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() {
this(DEFAULT_CATEGORY_LIST_PARAMS);
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/params/FacetSearchParams.java b/lucene/facet/src/java/org/apache/lucene/facet/params/FacetSearchParams.java
index 1bf3dfe44ab..f0a9805b014 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/params/FacetSearchParams.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/params/FacetSearchParams.java
@@ -40,22 +40,22 @@ public class FacetSearchParams {
/**
* 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 #FacetSearchParams(FacetIndexingParams, List)}.
*/
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
- * {@link FacetIndexingParams#ALL_PARENTS}. If you used a different
+ * {@link FacetIndexingParams#DEFAULT}. If you used a different
* {@link FacetIndexingParams}, you should use
* {@link #FacetSearchParams(FacetIndexingParams, List)}.
*/
public FacetSearchParams(List<FacetRequest> facetRequests) {
- this(FacetIndexingParams.ALL_PARENTS, facetRequests);
+ this(FacetIndexingParams.DEFAULT, facetRequests);
}
/**
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/util/OrdinalMappingAtomicReader.java b/lucene/facet/src/java/org/apache/lucene/facet/util/OrdinalMappingAtomicReader.java
index ad0a102d425..566d1e82e64 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/util/OrdinalMappingAtomicReader.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/util/OrdinalMappingAtomicReader.java
@@ -74,7 +74,7 @@ public class OrdinalMappingAtomicReader extends FilterAtomicReader {
* OrdinalMappingAtomicReader(in, ordinalMap, new DefaultFacetIndexingParams())}
*/
public OrdinalMappingAtomicReader(AtomicReader in, int[] ordinalMap) {
- this(in, ordinalMap, FacetIndexingParams.ALL_PARENTS);
+ this(in, ordinalMap, FacetIndexingParams.DEFAULT);
}
/**
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCountsCache.java b/lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCountsCache.java
index d70e608a47f..bc7d02e9055 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCountsCache.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCountsCache.java
@@ -187,7 +187,7 @@ public class TestTotalFacetCountsCache extends FacetTestCase {
Multi[] multis = new Multi[numThreads];
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) {
@@ -234,7 +234,7 @@ public class TestTotalFacetCountsCache extends FacetTestCase {
// Create our index/taxonomy writers
IndexWriter indexWriter = new IndexWriter(indexDir, newIndexWriterConfig(TEST_VERSION_CURRENT, null));
TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
- FacetIndexingParams iParams = FacetIndexingParams.ALL_PARENTS;
+ FacetIndexingParams iParams = FacetIndexingParams.DEFAULT;
// Add a facet to the index
addFacets(iParams, indexWriter, taxoWriter, "a", "b");
@@ -385,7 +385,7 @@ public class TestTotalFacetCountsCache extends FacetTestCase {
IndexWriter w = new IndexWriter(indexDir, new IndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
DirectoryTaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir);
- FacetIndexingParams iParams = FacetIndexingParams.ALL_PARENTS;
+ FacetIndexingParams iParams = FacetIndexingParams.DEFAULT;
// Add documents and facets
for (int i = 0; i < 1000; 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));
TaxonomyWriter taxoWriter1 = new DirectoryTaxonomyWriter(taxoDir1);
TaxonomyWriter taxoWriter2 = new DirectoryTaxonomyWriter(taxoDir2);
- FacetIndexingParams iParams = FacetIndexingParams.ALL_PARENTS;
+ FacetIndexingParams iParams = FacetIndexingParams.DEFAULT;
// Add a facet to the index
addFacets(iParams, indexWriter1, taxoWriter1, "a", "b");
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/params/FacetIndexingParamsTest.java b/lucene/facet/src/test/org/apache/lucene/facet/params/FacetIndexingParamsTest.java
index 4f475250737..20874b25028 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/params/FacetIndexingParamsTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/params/FacetIndexingParamsTest.java
@@ -30,7 +30,7 @@ public class FacetIndexingParamsTest extends FacetTestCase {
@Test
public void testDefaultSettings() {
- FacetIndexingParams dfip = FacetIndexingParams.ALL_PARENTS;
+ FacetIndexingParams dfip = FacetIndexingParams.DEFAULT;
assertNotNull("Missing default category list", dfip.getAllCategoryListParams());
assertEquals("all categories have the same CategoryListParams by default",
dfip.getCategoryListParams(null), dfip.getCategoryListParams(new CategoryPath("a")));