/** * Creates an iterator over term, weight and payload fields from the lucene * index. setting <code>withPayload</code> to false, implies an iterator * over only term and weight. */ public DocumentInputIterator(boolean hasPayloads, boolean hasContexts) throws IOException { this.hasPayloads = hasPayloads; this.hasContexts = hasContexts; docCount = reader.maxDoc() - 1; weightValues = (weightField != null) ? MultiDocValues.getNumericValues(reader, weightField) : null; liveDocs = (reader.leaves().size() > 0) ? MultiFields.getLiveDocs(reader) : null; relevantFields = getRelevantFields(new String [] {field, weightField, payloadField, contextsField}); }
currentWeight = getWeight(doc, currentDocId);
@Override public InputIterator getEntryIterator() throws IOException { return new DocumentInputIterator(payloadField!=null, contextsField!=null); }