mirror of https://github.com/apache/lucene.git
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:
parent
30e15a01c1
commit
3f8993715b
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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")));
|
||||
|
|
Loading…
Reference in New Issue