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.FacetTestCase;
|
||||||
import org.apache.lucene.facet.params.FacetSearchParams;
|
import org.apache.lucene.facet.params.FacetSearchParams;
|
||||||
import org.apache.lucene.facet.search.FacetResult;
|
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.FacetsCollector;
|
||||||
import org.apache.lucene.facet.search.TaxonomyFacetsAccumulator;
|
|
||||||
import org.apache.lucene.facet.taxonomy.CategoryPath;
|
import org.apache.lucene.facet.taxonomy.CategoryPath;
|
||||||
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
|
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
|
||||||
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
|
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
|
||||||
|
@ -110,14 +108,7 @@ public class AssociationsFacetRequestTest extends FacetTestCase {
|
||||||
|
|
||||||
Query q = new MatchAllDocsQuery();
|
Query q = new MatchAllDocsQuery();
|
||||||
|
|
||||||
TaxonomyFacetsAccumulator fa = new TaxonomyFacetsAccumulator(fsp, reader, taxo) {
|
FacetsCollector fc = FacetsCollector.create(fsp, reader, taxo);
|
||||||
@Override
|
|
||||||
public FacetsAggregator getAggregator() {
|
|
||||||
return new SumIntAssociationFacetsAggregator();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
FacetsCollector fc = FacetsCollector.create(fa);
|
|
||||||
|
|
||||||
IndexSearcher searcher = newSearcher(reader);
|
IndexSearcher searcher = newSearcher(reader);
|
||||||
searcher.search(q, fc);
|
searcher.search(q, fc);
|
||||||
|
@ -142,14 +133,7 @@ public class AssociationsFacetRequestTest extends FacetTestCase {
|
||||||
|
|
||||||
Query q = new MatchAllDocsQuery();
|
Query q = new MatchAllDocsQuery();
|
||||||
|
|
||||||
TaxonomyFacetsAccumulator fa = new TaxonomyFacetsAccumulator(fsp, reader, taxo) {
|
FacetsCollector fc = FacetsCollector.create(fsp, reader, taxo);
|
||||||
@Override
|
|
||||||
public FacetsAggregator getAggregator() {
|
|
||||||
return new SumFloatAssociationFacetsAggregator();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
FacetsCollector fc = FacetsCollector.create(fa);
|
|
||||||
|
|
||||||
IndexSearcher searcher = newSearcher(reader);
|
IndexSearcher searcher = newSearcher(reader);
|
||||||
searcher.search(q, fc);
|
searcher.search(q, fc);
|
||||||
|
|
|
@ -89,14 +89,8 @@ public class TestFacetsCollector extends FacetTestCase {
|
||||||
DirectoryReader r = DirectoryReader.open(indexDir);
|
DirectoryReader r = DirectoryReader.open(indexDir);
|
||||||
DirectoryTaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
|
DirectoryTaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
|
||||||
|
|
||||||
FacetSearchParams sParams = new FacetSearchParams(new SumScoreFacetRequest(new CategoryPath("a"), 10));
|
FacetSearchParams fsp = new FacetSearchParams(new SumScoreFacetRequest(new CategoryPath("a"), 10));
|
||||||
TaxonomyFacetsAccumulator fa = new TaxonomyFacetsAccumulator(sParams, r, taxo) {
|
FacetsCollector fc = FacetsCollector.create(fsp, r, taxo);
|
||||||
@Override
|
|
||||||
public FacetsAggregator getAggregator() {
|
|
||||||
return new SumScoreFacetsAggregator();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
FacetsCollector fc = FacetsCollector.create(fa);
|
|
||||||
TopScoreDocCollector topDocs = TopScoreDocCollector.create(10, false);
|
TopScoreDocCollector topDocs = TopScoreDocCollector.create(10, false);
|
||||||
ConstantScoreQuery csq = new ConstantScoreQuery(new MatchAllDocsQuery());
|
ConstantScoreQuery csq = new ConstantScoreQuery(new MatchAllDocsQuery());
|
||||||
csq.setBoost(2.0f);
|
csq.setBoost(2.0f);
|
||||||
|
@ -335,12 +329,7 @@ public class TestFacetsCollector extends FacetTestCase {
|
||||||
// assert IntFacetResultHandler
|
// assert IntFacetResultHandler
|
||||||
fsp = new FacetSearchParams(new SumScoreFacetRequest(new CategoryPath("a"), 10));
|
fsp = new FacetSearchParams(new SumScoreFacetRequest(new CategoryPath("a"), 10));
|
||||||
if (random().nextBoolean()) {
|
if (random().nextBoolean()) {
|
||||||
fa = new TaxonomyFacetsAccumulator(fsp, r, taxo) {
|
fa = new TaxonomyFacetsAccumulator(fsp, r, taxo);
|
||||||
@Override
|
|
||||||
public FacetsAggregator getAggregator() {
|
|
||||||
return new SumScoreFacetsAggregator();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
fa = new OldFacetsAccumulator(fsp, r, taxo);
|
fa = new OldFacetsAccumulator(fsp, r, taxo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue