Apache Lucene open-source search software
LUCENE-5339: simplify DrillDownQuery
Michael McCandless45a73c005e6b
diff --git a/TODO b/TODOindex 2574e6b637b..c2422db4364 100644--- a/TODO+++ b/TODO@@ -2,15 +2,14 @@ nocommit this!TODO- associations+ - nuke delimChar? can we escape instead?- wrap an IW instead of extending one?- re-enable ALL_BUT_DIM somehow?- - simplify ddq api- SSDVValueSourceFacets?- we could put more stuff into the "schema", e.g. this field issorted-set-DV and that one is taxo?- standardize on facet or facets (e.g. FacetIndexWriter)- fewer args when constructing a range- - rename CategoryPath -> FacetLabel- how to do avg() agg?- test needsScores=true / valuesource associations- make FieldTypes optional (if all your dims are flat)?diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/SumIntAssociationFacetsAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/SumIntAssociationFacetsAggregator.javaindex 1510c4cfbc4..e72a9501c8e 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/SumIntAssociationFacetsAggregator.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/SumIntAssociationFacetsAggregator.java@@ -56,7 +56,7 @@ public class SumIntAssociationFacetsAggregator implements FacetsAggregator {while (doc < length && (doc = matchingDocs.bits.nextSetBit(doc)) != -1) {dv.get(doc, bytes);if (bytes.length > 0) {- // aggreate association values for ordinals+ // aggregate association values for ordinalsint bytesUpto = bytes.offset + bytes.length;int pos = bytes.offset;while (pos < bytesUpto) {diff --git a/lucene/facet/src/java/org/apache/lucene/facet/simple/FacetsConfig.java b/lucene/facet/src/java/org/apache/lucene/facet/simple/FacetsConfig.javaindex d8869a1a828..95ac5d044ba 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/simple/FacetsConfig.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/simple/FacetsConfig.java@@ -28,8 +28,6 @@ public class FacetsConfig {// nocommit pull the delim char into there?// nocommit pull DimType into here (shai?)- // nocommit pull facet field ($facets) into here, instead- // of optionally setting it on FacetFieldprivate final Map<String,DimConfig> fieldTypes = new ConcurrentHashMap<String,DimConfig>();diff --git a/lucene/facet/src/java/org/apache/lucene/facet/simple/SimpleDrillDownQuery.java b/lucene/facet/src/java/org/apache/lucene/facet/simple/SimpleDrillDownQuery.javaindex cc0681c2bd3..10bb64496a0 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/simple/SimpleDrillDownQuery.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/simple/SimpleDrillDownQuery.java@@ -51,21 +51,23 @@ import org.apache.lucene.search.TermQuery;*/public final class SimpleDrillDownQuery extends Query {- private static Term term(String field, char delimChar, FacetLabel path) {- return new Term(field, path.toString(delimChar));+ private static Term term(String field, char delimChar, String dim, String[] path) {+ return new Term(field, FacetLabel.create(dim, path).toString(delimChar));}+ private final FacetsConfig config;private final BooleanQuery query;private final Map<String,Integer> drillDownDims = new LinkedHashMap<String,Integer>();/** Used by clone() */- SimpleDrillDownQuery(BooleanQuery query, Map<String,Integer> drillDownDims) {+ SimpleDrillDownQuery(FacetsConfig config, BooleanQuery query, Map<String,Integer> drillDownDims) {this.query = query.clone();this.drillDownDims.putAll(drillDownDims);+ this.config = config;}/** Used by DrillSideways */- SimpleDrillDownQuery(Filter filter, SimpleDrillDownQuery other) {+ SimpleDrillDownQuery(FacetsConfig config, Filter filter, SimpleDrillDownQuery other) {query = new BooleanQuery(true); // disable coordBooleanClause[] clauses = other.query.getClauses();@@ -78,10 +80,11 @@ public final class SimpleDrillDownQuery extends Query {for(int i=1;i<clauses.length;i++) {query.add(clauses[i].getQuery(), Occur.MUST);}+ this.config = config;}/** Used by DrillSideways */- SimpleDrillDownQuery(Query baseQuery, List<Query> clauses, Map<String,Integer> drillDownDims) {+ SimpleDrillDownQuery(FacetsConfig config, Query baseQuery, List<Query> clauses, Map<String,Integer> drillDownDims) {this.query = new BooleanQuery(true);if (baseQuery != null) {query.add(baseQuery, Occur.MUST);@@ -90,6 +93,7 @@ public final class SimpleDrillDownQuery extends Query {query.add(clause, Occur.MUST);}this.drillDownDims.putAll(drillDownDims);+ this.config = config;}/**@@ -97,8 +101,8 @@ public final class SimpleDrillDownQuery extends Query {* to perform a pure browsing query (equivalent to using* {@link MatchAllDocsQuery} as base).*/- public SimpleDrillDownQuery() {- this(null);+ public SimpleDrillDownQuery(FacetsConfig config) {+ this(config, null);}/**@@ -107,55 +111,57 @@ public final class SimpleDrillDownQuery extends Query {* {@link #rewrite(IndexReader)} will be a pure browsing query, filtering on* the added categories only.*/- public SimpleDrillDownQuery(Query baseQuery) {+ public SimpleDrillDownQuery(FacetsConfig config, Query baseQuery) {query = new BooleanQuery(true); // disable coordif (baseQuery != null) {query.add(baseQuery, Occur.MUST);}+ this.config = config;}- /**- * Adds one dimension of drill downs; if you pass multiple values they are- * OR'd, and then the entire dimension is AND'd against the base query.- */- // nocommit can we remove FacetLabel here?- public void add(FacetLabel... paths) {- add(FacetsConfig.DEFAULT_INDEXED_FIELD_NAME, Constants.DEFAULT_DELIM_CHAR, paths);- }+ /** Merges (ORs) a new path into an existing AND'd+ * clause. */+ private void merge(String dim, String[] path) {+ int index = drillDownDims.get(dim);+ if (query.getClauses().length == drillDownDims.size()+1) {+ index++;+ }+ ConstantScoreQuery q = (ConstantScoreQuery) query.clauses().get(index).getQuery();+ if ((q.getQuery() instanceof BooleanQuery) == false) {+ // App called .add(dim, customQuery) and then tried to+ // merge a facet label in:+ throw new RuntimeException("cannot merge with custom Query");+ }+ String indexedField = config.getDimConfig(dim).indexedFieldName;- // nocommit can we remove FacetLabel here?- public void add(String field, FacetLabel... paths) {- add(field, Constants.DEFAULT_DELIM_CHAR, paths);+ // nocommit pull this from FacetsConfig+ char delimChar = Constants.DEFAULT_DELIM_CHAR;+ BooleanQuery bq = (BooleanQuery) q.getQuery();+ bq.add(new TermQuery(term(indexedField, delimChar, dim, path)), Occur.SHOULD);}+ /** Adds one dimension of drill downs; if you pass the same+ * dimension again, it's OR'd with the previous+ * constraints on that dimension, and all dimensions are+ * AND'd against each other and the base query. */// nocommit can we remove FacetLabel here?- public void add(String field, char delimChar, FacetLabel... paths) {- Query q;- if (paths[0].length == 0) {- throw new IllegalArgumentException("all CategoryPaths must have length > 0");- }- String dim = paths[0].components[0];+ public void add(String dim, String... path) {+if (drillDownDims.containsKey(dim)) {- throw new IllegalArgumentException("dimension '" + dim + "' was already added");+ merge(dim, path);+ return;}- if (paths.length == 1) {- q = new TermQuery(term(field, delimChar, paths[0]));- } else {- BooleanQuery bq = new BooleanQuery(true); // disable coord- for (FacetLabel cp : paths) {- if (cp.length == 0) {- throw new IllegalArgumentException("all CategoryPaths must have length > 0");- }- if (!cp.components[0].equals(dim)) {- throw new IllegalArgumentException("multiple (OR'd) drill-down paths must be under same dimension; got '"- + dim + "' and '" + cp.components[0] + "'");- }- bq.add(new TermQuery(term(field, delimChar, cp)), Occur.SHOULD);- }- q = bq;+ String indexedField = config.getDimConfig(dim).indexedFieldName;++ // nocommit pull this from FacetsConfig+ char delimChar = Constants.DEFAULT_DELIM_CHAR;+ BooleanQuery bq = new BooleanQuery(true); // disable coord+ if (path.length == 0) {+ throw new IllegalArgumentException("must have at least one facet label under dim");}+ bq.add(new TermQuery(term(indexedField, delimChar, dim, path)), Occur.SHOULD);- add(dim, q);+ add(dim, bq);}/** Expert: add a custom drill-down subQuery. Use this@@ -177,7 +183,7 @@ public final class SimpleDrillDownQuery extends Query {@Overridepublic SimpleDrillDownQuery clone() {- return new SimpleDrillDownQuery(query, drillDownDims);+ return new SimpleDrillDownQuery(config, query, drillDownDims);}@Overridediff --git a/lucene/facet/src/java/org/apache/lucene/facet/simple/SimpleDrillSideways.java b/lucene/facet/src/java/org/apache/lucene/facet/simple/SimpleDrillSideways.javaindex 558825b3c0d..53d7b7d7ccf 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/simple/SimpleDrillSideways.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/simple/SimpleDrillSideways.java@@ -76,22 +76,22 @@ public class SimpleDrillSideways {protected final IndexSearcher searcher;protected final TaxonomyReader taxoReader;protected final SortedSetDocValuesReaderState state;- protected final FacetsConfig facetsConfig;+ protected final FacetsConfig config;/*** Create a new {@code DrillSideways} instance, assuming the categories were* indexed with {@link FacetFields}.*/- public SimpleDrillSideways(IndexSearcher searcher, FacetsConfig facetsConfig, TaxonomyReader taxoReader) {- this(searcher, facetsConfig, taxoReader, null);+ public SimpleDrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader) {+ this(searcher, config, taxoReader, null);}/*** Create a new {@code DrillSideways} instance, assuming the categories were* indexed with {@link SortedSetDocValuesFacetFields}.*/- public SimpleDrillSideways(IndexSearcher searcher, FacetsConfig facetsConfig, SortedSetDocValuesReaderState state) {- this(searcher, facetsConfig, null, state);+ public SimpleDrillSideways(IndexSearcher searcher, FacetsConfig config, SortedSetDocValuesReaderState state) {+ this(searcher, config, null, state);}/**@@ -99,9 +99,9 @@ public class SimpleDrillSideways {* dimensions are sorted set facets and others are* taxononmy facets.*/- public SimpleDrillSideways(IndexSearcher searcher, FacetsConfig facetsConfig, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state) {+ public SimpleDrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state) {this.searcher = searcher;- this.facetsConfig = facetsConfig;+ this.config = config;this.taxoReader = taxoReader;this.state = state;}@@ -110,7 +110,7 @@ public class SimpleDrillSideways {* impl. */protected Facets buildFacetsResult(SimpleFacetsCollector drillDowns, SimpleFacetsCollector[] drillSideways, String[] drillSidewaysDims) throws IOException {- Facets drillDownFacets = new FastTaxonomyFacetCounts(taxoReader, facetsConfig, drillDowns);+ Facets drillDownFacets = new FastTaxonomyFacetCounts(taxoReader, config, drillDowns);if (drillSideways == null) {return drillDownFacets;@@ -118,7 +118,7 @@ public class SimpleDrillSideways {Map<String,Facets> drillSidewaysFacets = new HashMap<String,Facets>();for(int i=0;i<drillSideways.length;i++) {drillSidewaysFacets.put(drillSidewaysDims[i],- new FastTaxonomyFacetCounts(taxoReader, facetsConfig, drillSideways[i]));+ new FastTaxonomyFacetCounts(taxoReader, config, drillSideways[i]));}return new MultiFacets(drillSidewaysFacets, drillDownFacets);}@@ -313,7 +313,7 @@ public class SimpleDrillSideways {Filter filter, FieldDoc after, int topN, Sort sort, boolean doDocScores,boolean doMaxScore) throws IOException {if (filter != null) {- query = new SimpleDrillDownQuery(filter, query);+ query = new SimpleDrillDownQuery(config, filter, query);}if (sort != null) {int limit = searcher.getIndexReader().maxDoc();diff --git a/lucene/facet/src/test/org/apache/lucene/facet/simple/TestSimpleDrillSideways.java b/lucene/facet/src/test/org/apache/lucene/facet/simple/TestSimpleDrillSideways.javaindex c8033296a8d..82a6cd6bac3 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/simple/TestSimpleDrillSideways.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/simple/TestSimpleDrillSideways.java@@ -39,7 +39,6 @@ import org.apache.lucene.facet.params.FacetSearchParams;import org.apache.lucene.facet.simple.SimpleDrillSideways.SimpleDrillSidewaysResult;import org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetFields;import org.apache.lucene.facet.sortedset.SortedSetDocValuesReaderState;-import org.apache.lucene.facet.taxonomy.FacetLabel;import org.apache.lucene.facet.taxonomy.TaxonomyReader;import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;@@ -132,8 +131,8 @@ public class TestSimpleDrillSideways extends FacetTestCase {// Simple case: drill-down on a single field; in this// case the drill-sideways + drill-down counts ==// drill-down of just the query:- SimpleDrillDownQuery ddq = new SimpleDrillDownQuery();- ddq.add(new FacetLabel("Author", "Lisa"));+ SimpleDrillDownQuery ddq = new SimpleDrillDownQuery(config);+ ddq.add("Author", "Lisa");SimpleDrillSidewaysResult r = ds.search(null, ddq, 10);assertEquals(2, r.hits.totalHits);// Publish Date is only drill-down, and Lisa published@@ -149,8 +148,8 @@ public class TestSimpleDrillSideways extends FacetTestCase {// drill-down on a single field; in this case the// drill-sideways + drill-down counts == drill-down of// just the query:- ddq = new SimpleDrillDownQuery();- ddq.add(new FacetLabel("Author", "Lisa"));+ ddq = new SimpleDrillDownQuery(config);+ ddq.add("Author", "Lisa");r = ds.search(null, ddq, 10);assertEquals(2, r.hits.totalHits);@@ -165,8 +164,9 @@ public class TestSimpleDrillSideways extends FacetTestCase {// Another simple case: drill-down on on single fields// but OR of two values- ddq = new SimpleDrillDownQuery();- ddq.add(new FacetLabel("Author", "Lisa"), new FacetLabel("Author", "Bob"));+ ddq = new SimpleDrillDownQuery(config);+ ddq.add("Author", "Lisa");+ ddq.add("Author", "Bob");r = ds.search(null, ddq, 10);assertEquals(3, r.hits.totalHits);// Publish Date is only drill-down: Lisa and Bob@@ -178,9 +178,9 @@ public class TestSimpleDrillSideways extends FacetTestCase {assertEquals("Author (5)\n Lisa (2)\n Bob (1)\n Susan (1)\n Frank (1)\n", r.facets.getTopChildren(10, "Author").toString());// More interesting case: drill-down on two fields- ddq = new SimpleDrillDownQuery();- ddq.add(new FacetLabel("Author", "Lisa"));- ddq.add(new FacetLabel("Publish Date", "2010"));+ ddq = new SimpleDrillDownQuery(config);+ ddq.add("Author", "Lisa");+ ddq.add("Publish Date", "2010");r = ds.search(null, ddq, 10);assertEquals(1, r.hits.totalHits);// Publish Date is drill-sideways + drill-down: Lisa@@ -192,12 +192,12 @@ public class TestSimpleDrillSideways extends FacetTestCase {// Even more interesting case: drill down on two fields,// but one of them is OR- ddq = new SimpleDrillDownQuery();+ ddq = new SimpleDrillDownQuery(config);// Drill down on Lisa or Bob:- ddq.add(new FacetLabel("Author", "Lisa"),- new FacetLabel("Author", "Bob"));- ddq.add(new FacetLabel("Publish Date", "2010"));+ ddq.add("Author", "Lisa");+ ddq.add("Publish Date", "2010");+ ddq.add("Author", "Bob");r = ds.search(null, ddq, 10);assertEquals(2, r.hits.totalHits);// Publish Date is both drill-sideways + drill-down:@@ -208,17 +208,17 @@ public class TestSimpleDrillSideways extends FacetTestCase {assertEquals("Author (2)\n Bob (1)\n Lisa (1)\n", r.facets.getTopChildren(10, "Author").toString());// Test drilling down on invalid field:- ddq = new SimpleDrillDownQuery();- ddq.add(new FacetLabel("Foobar", "Baz"));+ ddq = new SimpleDrillDownQuery(config);+ ddq.add("Foobar", "Baz");r = ds.search(null, ddq, 10);assertEquals(0, r.hits.totalHits);assertNull(r.facets.getTopChildren(10, "Publish Date"));assertNull(r.facets.getTopChildren(10, "Foobar"));// Test drilling down on valid term or'd with invalid term:- ddq = new SimpleDrillDownQuery();- ddq.add(new FacetLabel("Author", "Lisa"),- new FacetLabel("Author", "Tom"));+ ddq = new SimpleDrillDownQuery(config);+ ddq.add("Author", "Lisa");+ ddq.add("Author", "Tom");r = ds.search(null, ddq, 10);assertEquals(2, r.hits.totalHits);// Publish Date is only drill-down, and Lisa published@@ -231,9 +231,9 @@ public class TestSimpleDrillSideways extends FacetTestCase {// LUCENE-4915: test drilling down on a dimension but// NOT facet counting it:- ddq = new SimpleDrillDownQuery();- ddq.add(new FacetLabel("Author", "Lisa"),- new FacetLabel("Author", "Tom"));+ ddq = new SimpleDrillDownQuery(config);+ ddq.add("Author", "Lisa");+ ddq.add("Author", "Tom");r = ds.search(null, ddq, 10);assertEquals(2, r.hits.totalHits);// Publish Date is only drill-down, and Lisa published@@ -241,8 +241,8 @@ public class TestSimpleDrillSideways extends FacetTestCase {assertEquals("Publish Date (2)\n 2010 (1)\n 2012 (1)\n", r.facets.getTopChildren(10, "Publish Date").toString());// Test main query gets null scorer:- ddq = new SimpleDrillDownQuery(new TermQuery(new Term("foobar", "baz")));- ddq.add(new FacetLabel("Author", "Lisa"));+ ddq = new SimpleDrillDownQuery(config, new TermQuery(new Term("foobar", "baz")));+ ddq.add("Author", "Lisa");r = ds.search(null, ddq, 10);assertEquals(0, r.hits.totalHits);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/simple/TestSortedSetDocValuesFacets.java b/lucene/facet/src/test/org/apache/lucene/facet/simple/TestSortedSetDocValuesFacets.javaindex 1f0a4e8d066..37b1f28c0d4 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/simple/TestSortedSetDocValuesFacets.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/simple/TestSortedSetDocValuesFacets.java@@ -27,7 +27,6 @@ import org.apache.lucene.facet.FacetTestCase;import org.apache.lucene.facet.search.FacetsCollector;import org.apache.lucene.facet.simple.SortedSetDocValuesFacetCounts;import org.apache.lucene.facet.simple.SortedSetDocValuesReaderState;-import org.apache.lucene.facet.taxonomy.FacetLabel;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.IndexWriter;@@ -46,7 +45,8 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {assumeTrue("Test requires SortedSetDV support", defaultCodecSupportsSortedSet());Directory dir = newDirectory();- IndexWriter writer = new FacetIndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())), null, new FacetsConfig());+ FacetsConfig config = new FacetsConfig();+ IndexWriter writer = new FacetIndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())), null, config);Document doc = new Document();doc.add(new SortedSetDocValuesFacetField("a", "foo"));@@ -79,9 +79,9 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {assertEquals("b (1)\n baz (1)\n", facets.getTopChildren(10, "b").toString());// DrillDown:- SimpleDrillDownQuery q = new SimpleDrillDownQuery();- q.add(new FacetLabel("a", "foo"));- q.add(new FacetLabel("b", "baz"));+ SimpleDrillDownQuery q = new SimpleDrillDownQuery(config);+ q.add("a", "foo");+ q.add("b", "baz");TopDocs hits = searcher.search(q, 1);assertEquals(1, hits.totalHits);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/simple/TestTaxonomyFacets.java b/lucene/facet/src/test/org/apache/lucene/facet/simple/TestTaxonomyFacets.javaindex 7624632b85d..4c7767d885d 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/simple/TestTaxonomyFacets.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/simple/TestTaxonomyFacets.java@@ -18,7 +18,6 @@ package org.apache.lucene.facet.simple;*/import java.io.ByteArrayOutputStream;-import java.io.IOException;import java.io.PrintStream;import java.util.ArrayList;import java.util.Collections;@@ -30,7 +29,6 @@ import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.facet.FacetTestCase;-import org.apache.lucene.facet.taxonomy.FacetLabel;import org.apache.lucene.facet.taxonomy.TaxonomyReader;import org.apache.lucene.facet.taxonomy.TaxonomyWriter;import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;@@ -60,10 +58,10 @@ public class TestTaxonomyFacets extends FacetTestCase {// main index:DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode.CREATE);- FacetsConfig fts = new FacetsConfig();- fts.setHierarchical("Publish Date");+ FacetsConfig config = new FacetsConfig();+ config.setHierarchical("Publish Date");- IndexWriter writer = new FacetIndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())), taxoWriter, fts);+ IndexWriter writer = new FacetIndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())), taxoWriter, config);Document doc = new Document();doc.add(new FacetField("Author", "Bob"));@@ -107,18 +105,18 @@ public class TestTaxonomyFacets extends FacetTestCase {// wrap collecting the "normal" hits and also facets:searcher.search(new MatchAllDocsQuery(), c);- Facets facets = new FastTaxonomyFacetCounts(taxoReader, fts, c);+ Facets facets = new FastTaxonomyFacetCounts(taxoReader, config, c);// Retrieve & verify results:assertEquals("Publish Date (5)\n 2010 (2)\n 2012 (2)\n 1999 (1)\n", facets.getTopChildren(10, "Publish Date").toString());assertEquals("Author (5)\n Lisa (2)\n Bob (1)\n Susan (1)\n Frank (1)\n", facets.getTopChildren(10, "Author").toString());// Now user drills down on Publish Date/2010:- SimpleDrillDownQuery q2 = new SimpleDrillDownQuery(new MatchAllDocsQuery());- q2.add(new FacetLabel("Publish Date", "2010"));+ SimpleDrillDownQuery q2 = new SimpleDrillDownQuery(config);+ q2.add("Publish Date", "2010");c = new SimpleFacetsCollector();searcher.search(q2, c);- facets = new FastTaxonomyFacetCounts(taxoReader, fts, c);+ facets = new FastTaxonomyFacetCounts(taxoReader, config, c);assertEquals("Author (2)\n Bob (1)\n Lisa (1)\n", facets.getTopChildren(10, "Author").toString());assertEquals(1, facets.getSpecificValue("Author", "Lisa"));