Exemplo n.º 1
0
 /// <summary>
 /// Creates an iterator over term, weight and payload fields from the lucene
 /// index. setting <see cref="HasPayloads"/> to false, implies an iterator
 /// over only term and weight.
 /// </summary>
 public DocumentInputIterator(DocumentDictionary outerInstance, bool hasPayloads, bool hasContexts)
 {
     this.outerInstance = outerInstance;
     this.hasPayloads   = hasPayloads;
     this.hasContexts   = hasContexts;
     docCount           = outerInstance.reader.MaxDoc - 1;
     weightValues       = (outerInstance.weightField != null) ? MultiDocValues.GetNumericValues(outerInstance.reader, outerInstance.weightField) : null;
     liveDocs           = (outerInstance.reader.Leaves.Count > 0) ? MultiFields.GetLiveDocs(outerInstance.reader) : null;
     relevantFields     = GetRelevantFields(new string[] { outerInstance.field, outerInstance.weightField, outerInstance.payloadField, outerInstance.contextsField });
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an iterator over term, weight and payload fields from the lucene
 /// index. Setting <paramref name="hasPayloads"/> to <c>false</c>, implies an enumerator
 /// over only term and weight.
 /// </summary>
 public DocumentInputEnumerator(DocumentDictionary documentDictionary, bool hasPayloads, bool hasContexts)
 {
     this.outerInstance = documentDictionary;
     this.hasPayloads   = hasPayloads;
     this.hasContexts   = hasContexts;
     docCount           = documentDictionary.m_reader.MaxDoc - 1;
     weightValues       = (documentDictionary.weightField != null) ? MultiDocValues.GetNumericValues(documentDictionary.m_reader, documentDictionary.weightField) : null;
     liveDocs           = (documentDictionary.m_reader.Leaves.Count > 0) ? MultiFields.GetLiveDocs(documentDictionary.m_reader) : null;
     relevantFields     = GetRelevantFields(new string[] { documentDictionary.field, documentDictionary.weightField, documentDictionary.m_payloadField, documentDictionary.m_contextsField });
 }