mirror of https://github.com/apache/lucene.git
remove redundant code
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1532980 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
086ec7c493
commit
9cda012557
|
@ -8,9 +8,7 @@ import org.apache.lucene.document.Document;
|
|||
import org.apache.lucene.facet.FacetTestCase;
|
||||
import org.apache.lucene.facet.params.FacetSearchParams;
|
||||
import org.apache.lucene.facet.search.FacetResult;
|
||||
import org.apache.lucene.facet.search.FacetsAggregator;
|
||||
import org.apache.lucene.facet.search.FacetsCollector;
|
||||
import org.apache.lucene.facet.search.TaxonomyFacetsAccumulator;
|
||||
import org.apache.lucene.facet.taxonomy.CategoryPath;
|
||||
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
|
||||
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
|
||||
|
@ -110,14 +108,7 @@ public class AssociationsFacetRequestTest extends FacetTestCase {
|
|||
|
||||
Query q = new MatchAllDocsQuery();
|
||||
|
||||
TaxonomyFacetsAccumulator fa = new TaxonomyFacetsAccumulator(fsp, reader, taxo) {
|
||||
@Override
|
||||
public FacetsAggregator getAggregator() {
|
||||
return new SumIntAssociationFacetsAggregator();
|
||||
}
|
||||
};
|
||||
|
||||
FacetsCollector fc = FacetsCollector.create(fa);
|
||||
FacetsCollector fc = FacetsCollector.create(fsp, reader, taxo);
|
||||
|
||||
IndexSearcher searcher = newSearcher(reader);
|
||||
searcher.search(q, fc);
|
||||
|
@ -142,14 +133,7 @@ public class AssociationsFacetRequestTest extends FacetTestCase {
|
|||
|
||||
Query q = new MatchAllDocsQuery();
|
||||
|
||||
TaxonomyFacetsAccumulator fa = new TaxonomyFacetsAccumulator(fsp, reader, taxo) {
|
||||
@Override
|
||||
public FacetsAggregator getAggregator() {
|
||||
return new SumFloatAssociationFacetsAggregator();
|
||||
}
|
||||
};
|
||||
|
||||
FacetsCollector fc = FacetsCollector.create(fa);
|
||||
FacetsCollector fc = FacetsCollector.create(fsp, reader, taxo);
|
||||
|
||||
IndexSearcher searcher = newSearcher(reader);
|
||||
searcher.search(q, fc);
|
||||
|
|
|
@ -89,14 +89,8 @@ public class TestFacetsCollector extends FacetTestCase {
|
|||
DirectoryReader r = DirectoryReader.open(indexDir);
|
||||
DirectoryTaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
|
||||
|
||||
FacetSearchParams sParams = new FacetSearchParams(new SumScoreFacetRequest(new CategoryPath("a"), 10));
|
||||
TaxonomyFacetsAccumulator fa = new TaxonomyFacetsAccumulator(sParams, r, taxo) {
|
||||
@Override
|
||||
public FacetsAggregator getAggregator() {
|
||||
return new SumScoreFacetsAggregator();
|
||||
}
|
||||
};
|
||||
FacetsCollector fc = FacetsCollector.create(fa);
|
||||
FacetSearchParams fsp = new FacetSearchParams(new SumScoreFacetRequest(new CategoryPath("a"), 10));
|
||||
FacetsCollector fc = FacetsCollector.create(fsp, r, taxo);
|
||||
TopScoreDocCollector topDocs = TopScoreDocCollector.create(10, false);
|
||||
ConstantScoreQuery csq = new ConstantScoreQuery(new MatchAllDocsQuery());
|
||||
csq.setBoost(2.0f);
|
||||
|
@ -335,12 +329,7 @@ public class TestFacetsCollector extends FacetTestCase {
|
|||
// assert IntFacetResultHandler
|
||||
fsp = new FacetSearchParams(new SumScoreFacetRequest(new CategoryPath("a"), 10));
|
||||
if (random().nextBoolean()) {
|
||||
fa = new TaxonomyFacetsAccumulator(fsp, r, taxo) {
|
||||
@Override
|
||||
public FacetsAggregator getAggregator() {
|
||||
return new SumScoreFacetsAggregator();
|
||||
}
|
||||
};
|
||||
fa = new TaxonomyFacetsAccumulator(fsp, r, taxo);
|
||||
} else {
|
||||
fa = new OldFacetsAccumulator(fsp, r, taxo);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue