Search in sources :

Example 6 with MultiSortedSetDocValues

use of org.apache.lucene.index.MultiDocValues.MultiSortedSetDocValues in project lucene-solr by apache.

the class SortedSetDocValuesFacetCounts method count.

/** Does all the "real work" of tallying up the counts. */
private final void count(List<MatchingDocs> matchingDocs) throws IOException {
    //System.out.println("ssdv count");
    MultiDocValues.OrdinalMap ordinalMap;
    // matchingDocs...
    if (dv instanceof MultiDocValues.MultiSortedSetDocValues && matchingDocs.size() > 1) {
        ordinalMap = ((MultiSortedSetDocValues) dv).mapping;
    } else {
        ordinalMap = null;
    }
    IndexReader reader = state.getReader();
    for (MatchingDocs hits : matchingDocs) {
        // AIOOBE can happen:
        if (ReaderUtil.getTopLevelContext(hits.context).reader() != reader) {
            throw new IllegalStateException("the SortedSetDocValuesReaderState provided to this class does not match the reader being searched; you must create a new SortedSetDocValuesReaderState every time you open a new IndexReader");
        }
        countOneSegment(ordinalMap, hits.context.reader(), hits.context.ord, hits);
    }
}
Also used : MatchingDocs(org.apache.lucene.facet.FacetsCollector.MatchingDocs) IndexReader(org.apache.lucene.index.IndexReader) MultiSortedSetDocValues(org.apache.lucene.index.MultiDocValues.MultiSortedSetDocValues) MultiDocValues(org.apache.lucene.index.MultiDocValues)

Aggregations

MultiDocValues (org.apache.lucene.index.MultiDocValues)6 MultiSortedSetDocValues (org.apache.lucene.index.MultiDocValues.MultiSortedSetDocValues)6 LeafReaderContext (org.apache.lucene.index.LeafReaderContext)4 IndexReader (org.apache.lucene.index.IndexReader)3 OrdinalMap (org.apache.lucene.index.MultiDocValues.OrdinalMap)3 SortedSetDocValues (org.apache.lucene.index.SortedSetDocValues)3 ArrayList (java.util.ArrayList)2 ExecutionException (java.util.concurrent.ExecutionException)2 Future (java.util.concurrent.Future)2 MatchingDocs (org.apache.lucene.facet.FacetsCollector.MatchingDocs)2 SortedDocValues (org.apache.lucene.index.SortedDocValues)2 DocIdSet (org.apache.lucene.search.DocIdSet)2 DocIdSetIterator (org.apache.lucene.search.DocIdSetIterator)2 BytesRef (org.apache.lucene.util.BytesRef)2 FieldType (org.apache.solr.schema.FieldType)2 SchemaField (org.apache.solr.schema.SchemaField)2 Filter (org.apache.solr.search.Filter)2 FieldInfo (org.apache.lucene.index.FieldInfo)1 LeafReader (org.apache.lucene.index.LeafReader)1 BytesRefBuilder (org.apache.lucene.util.BytesRefBuilder)1