mirror of https://github.com/apache/lucene.git
LUCENE-5339: renames
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5339@1543213 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5126543569
commit
7027c5690e
|
@ -32,16 +32,15 @@ import org.apache.lucene.index.BinaryDocValues;
|
||||||
import org.apache.lucene.util.BytesRef;
|
import org.apache.lucene.util.BytesRef;
|
||||||
import org.apache.lucene.util.FixedBitSet;
|
import org.apache.lucene.util.FixedBitSet;
|
||||||
|
|
||||||
// nocommit rename to TaxonomySumFloatAssociationFacets
|
|
||||||
// nocommit jdoc that this assumes/requires the default encoding
|
// nocommit jdoc that this assumes/requires the default encoding
|
||||||
public class SumFloatAssociationFacets extends TaxonomyFacets {
|
public class TaxonomyFacetSumFloatAssociations extends TaxonomyFacets {
|
||||||
private final float[] values;
|
private final float[] values;
|
||||||
|
|
||||||
public SumFloatAssociationFacets(TaxonomyReader taxoReader, FacetsConfig config, SimpleFacetsCollector fc) throws IOException {
|
public TaxonomyFacetSumFloatAssociations(TaxonomyReader taxoReader, FacetsConfig config, SimpleFacetsCollector fc) throws IOException {
|
||||||
this(FacetsConfig.DEFAULT_INDEX_FIELD_NAME, taxoReader, config, fc);
|
this(FacetsConfig.DEFAULT_INDEX_FIELD_NAME, taxoReader, config, fc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SumFloatAssociationFacets(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, SimpleFacetsCollector fc) throws IOException {
|
public TaxonomyFacetSumFloatAssociations(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, SimpleFacetsCollector fc) throws IOException {
|
||||||
super(indexFieldName, taxoReader, config);
|
super(indexFieldName, taxoReader, config);
|
||||||
values = new float[taxoReader.getSize()];
|
values = new float[taxoReader.getSize()];
|
||||||
sumValues(fc.getMatchingDocs());
|
sumValues(fc.getMatchingDocs());
|
|
@ -32,16 +32,15 @@ import org.apache.lucene.index.BinaryDocValues;
|
||||||
import org.apache.lucene.util.BytesRef;
|
import org.apache.lucene.util.BytesRef;
|
||||||
import org.apache.lucene.util.FixedBitSet;
|
import org.apache.lucene.util.FixedBitSet;
|
||||||
|
|
||||||
// nocommit rename to TaxonomySumIntAssociationFacets
|
|
||||||
// nocommit jdoc that this assumes/requires the default encoding
|
// nocommit jdoc that this assumes/requires the default encoding
|
||||||
public class SumIntAssociationFacets extends TaxonomyFacets {
|
public class TaxonomyFacetSumIntAssociations extends TaxonomyFacets {
|
||||||
private final int[] values;
|
private final int[] values;
|
||||||
|
|
||||||
public SumIntAssociationFacets(TaxonomyReader taxoReader, FacetsConfig config, SimpleFacetsCollector fc) throws IOException {
|
public TaxonomyFacetSumIntAssociations(TaxonomyReader taxoReader, FacetsConfig config, SimpleFacetsCollector fc) throws IOException {
|
||||||
this(FacetsConfig.DEFAULT_INDEX_FIELD_NAME, taxoReader, config, fc);
|
this(FacetsConfig.DEFAULT_INDEX_FIELD_NAME, taxoReader, config, fc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SumIntAssociationFacets(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, SimpleFacetsCollector fc) throws IOException {
|
public TaxonomyFacetSumIntAssociations(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, SimpleFacetsCollector fc) throws IOException {
|
||||||
super(indexFieldName, taxoReader, config);
|
super(indexFieldName, taxoReader, config);
|
||||||
values = new int[taxoReader.getSize()];
|
values = new int[taxoReader.getSize()];
|
||||||
sumValues(fc.getMatchingDocs());
|
sumValues(fc.getMatchingDocs());
|
|
@ -44,7 +44,7 @@ import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
|
||||||
/** Test for associations */
|
/** Test for associations */
|
||||||
public class TestAssociationFacets extends FacetTestCase {
|
public class TestTaxonomyFacetAssociations extends FacetTestCase {
|
||||||
|
|
||||||
private static Directory dir;
|
private static Directory dir;
|
||||||
private static IndexReader reader;
|
private static IndexReader reader;
|
||||||
|
@ -113,7 +113,7 @@ public class TestAssociationFacets extends FacetTestCase {
|
||||||
IndexSearcher searcher = newSearcher(reader);
|
IndexSearcher searcher = newSearcher(reader);
|
||||||
searcher.search(new MatchAllDocsQuery(), fc);
|
searcher.search(new MatchAllDocsQuery(), fc);
|
||||||
|
|
||||||
Facets facets = new SumIntAssociationFacets("$facets.int", taxoReader, config, fc);
|
Facets facets = new TaxonomyFacetSumIntAssociations("$facets.int", taxoReader, config, fc);
|
||||||
|
|
||||||
assertEquals("Wrong count for category 'a'!", 200, facets.getSpecificValue("int", "a").intValue());
|
assertEquals("Wrong count for category 'a'!", 200, facets.getSpecificValue("int", "a").intValue());
|
||||||
assertEquals("Wrong count for category 'b'!", 150, facets.getSpecificValue("int", "b").intValue());
|
assertEquals("Wrong count for category 'b'!", 150, facets.getSpecificValue("int", "b").intValue());
|
||||||
|
@ -125,7 +125,7 @@ public class TestAssociationFacets extends FacetTestCase {
|
||||||
IndexSearcher searcher = newSearcher(reader);
|
IndexSearcher searcher = newSearcher(reader);
|
||||||
searcher.search(new MatchAllDocsQuery(), fc);
|
searcher.search(new MatchAllDocsQuery(), fc);
|
||||||
|
|
||||||
Facets facets = new SumFloatAssociationFacets("$facets.float", taxoReader, config, fc);
|
Facets facets = new TaxonomyFacetSumFloatAssociations("$facets.float", taxoReader, config, fc);
|
||||||
assertEquals("Wrong count for category 'a'!", 50f, facets.getSpecificValue("float", "a").floatValue(), 0.00001);
|
assertEquals("Wrong count for category 'a'!", 50f, facets.getSpecificValue("float", "a").floatValue(), 0.00001);
|
||||||
assertEquals("Wrong count for category 'b'!", 10f, facets.getSpecificValue("float", "b").floatValue(), 0.00001);
|
assertEquals("Wrong count for category 'b'!", 10f, facets.getSpecificValue("float", "b").floatValue(), 0.00001);
|
||||||
}
|
}
|
||||||
|
@ -138,11 +138,11 @@ public class TestAssociationFacets extends FacetTestCase {
|
||||||
IndexSearcher searcher = newSearcher(reader);
|
IndexSearcher searcher = newSearcher(reader);
|
||||||
searcher.search(new MatchAllDocsQuery(), fc);
|
searcher.search(new MatchAllDocsQuery(), fc);
|
||||||
|
|
||||||
Facets facets = new SumFloatAssociationFacets("$facets.float", taxoReader, config, fc);
|
Facets facets = new TaxonomyFacetSumFloatAssociations("$facets.float", taxoReader, config, fc);
|
||||||
assertEquals("Wrong count for category 'a'!", 50f, facets.getSpecificValue("float", "a").floatValue(), 0.00001);
|
assertEquals("Wrong count for category 'a'!", 50f, facets.getSpecificValue("float", "a").floatValue(), 0.00001);
|
||||||
assertEquals("Wrong count for category 'b'!", 10f, facets.getSpecificValue("float", "b").floatValue(), 0.00001);
|
assertEquals("Wrong count for category 'b'!", 10f, facets.getSpecificValue("float", "b").floatValue(), 0.00001);
|
||||||
|
|
||||||
facets = new SumIntAssociationFacets("$facets.int", taxoReader, config, fc);
|
facets = new TaxonomyFacetSumIntAssociations("$facets.int", taxoReader, config, fc);
|
||||||
assertEquals("Wrong count for category 'a'!", 200, facets.getSpecificValue("int", "a").intValue());
|
assertEquals("Wrong count for category 'a'!", 200, facets.getSpecificValue("int", "a").intValue());
|
||||||
assertEquals("Wrong count for category 'b'!", 150, facets.getSpecificValue("int", "b").intValue());
|
assertEquals("Wrong count for category 'b'!", 150, facets.getSpecificValue("int", "b").intValue());
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ public class TestAssociationFacets extends FacetTestCase {
|
||||||
|
|
||||||
IndexSearcher searcher = newSearcher(reader);
|
IndexSearcher searcher = newSearcher(reader);
|
||||||
searcher.search(new MatchAllDocsQuery(), fc);
|
searcher.search(new MatchAllDocsQuery(), fc);
|
||||||
Facets facets = new SumFloatAssociationFacets(taxoReader, config, fc);
|
Facets facets = new TaxonomyFacetSumFloatAssociations(taxoReader, config, fc);
|
||||||
try {
|
try {
|
||||||
facets.getSpecificValue("float");
|
facets.getSpecificValue("float");
|
||||||
fail("should have hit exc");
|
fail("should have hit exc");
|
|
@ -48,7 +48,7 @@ import org.apache.lucene.util.BytesRef;
|
||||||
import org.apache.lucene.util.IOUtils;
|
import org.apache.lucene.util.IOUtils;
|
||||||
import org.apache.lucene.util._TestUtil;
|
import org.apache.lucene.util._TestUtil;
|
||||||
|
|
||||||
public class TestTaxonomyFacets extends FacetTestCase {
|
public class TestTaxonomyFacetCounts extends FacetTestCase {
|
||||||
|
|
||||||
public void testBasic() throws Exception {
|
public void testBasic() throws Exception {
|
||||||
Directory dir = newDirectory();
|
Directory dir = newDirectory();
|
|
@ -52,7 +52,7 @@ import org.apache.lucene.util.BytesRef;
|
||||||
import org.apache.lucene.util.IOUtils;
|
import org.apache.lucene.util.IOUtils;
|
||||||
import org.apache.lucene.util._TestUtil;
|
import org.apache.lucene.util._TestUtil;
|
||||||
|
|
||||||
public class TestTaxonomyFacetsSumValueSource extends FacetTestCase {
|
public class TestTaxonomyFacetSumValueSource extends FacetTestCase {
|
||||||
|
|
||||||
public void testBasic() throws Exception {
|
public void testBasic() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue