use of org.apache.lucene.index.SortedDocValues in project stargate-core by tuplejump.
the class IndexEntryCollector method getIndexEntry.
IndexEntry getIndexEntry(int slot, int doc, float score) throws IOException {
String pkName = LuceneUtils.primaryKeyName(pkNames, doc);
ByteBuffer primaryKey = LuceneUtils.byteBufferDocValue(primaryKeys, doc);
ByteBuffer rowKey = LuceneUtils.byteBufferDocValue(rowKeys, doc);
Map<String, Number> numericDocValues = new HashMap<>();
Map<String, String> binaryDocValues = new HashMap<>();
for (Map.Entry<String, NumericDocValues> entry : numericDocValuesMap.entrySet()) {
Type type = AggregateFunction.getLuceneType(options, entry.getKey());
Number number = LuceneUtils.numericDocValue(entry.getValue(), doc, type);
numericDocValues.put(entry.getKey(), number);
}
for (Map.Entry<String, SortedDocValues> entry : stringDocValues.entrySet()) {
binaryDocValues.put(entry.getKey(), LuceneUtils.stringDocValue(entry.getValue(), doc));
}
return new IndexEntry(rowKey, pkName, primaryKey, slot, docBase + doc, score, numericDocValues, binaryDocValues);
}
Aggregations