dsmiley commented on a change in pull request #1151: SOLR-13890: Add "top-level" DVTQ implementation URL: https://github.com/apache/lucene-solr/pull/1151#discussion_r364302655
########## File path: solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java ########## @@ -142,4 +158,112 @@ public Query parse() throws SyntaxError { } }; } + + private static class TopLevelDocValuesTermsQuery extends DocValuesTermsQuery implements ExtendedQuery{ + private final String fieldName; + private SortedSetDocValues topLevelDocValues; + private LongBitSet topLevelTermOrdinals; + private boolean matchesAtLeastOneTerm = false; + private boolean cache = true; + private boolean cacheSeparately = false; + private int cost; + + + public TopLevelDocValuesTermsQuery(String field, BytesRef... terms) { + super(field, terms); + this.fieldName = field; + } + + public Weight createWeight(IndexSearcher searcher, final ScoreMode scoreMode, float boost) throws IOException { + topLevelDocValues = DocValues.getSortedSet(((SolrIndexSearcher)searcher).getSlowAtomicReader(), fieldName); Review comment: If not a SolrIndexSearcher than return super.createWeight (your idea based on Mikhail's comment) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org