mirror of https://github.com/apache/lucene.git
clear nocommit
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1439878 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7e683d8ed0
commit
e8a0b98b15
|
@ -64,12 +64,12 @@ public abstract class FieldsConsumer implements Closeable {
|
|||
* implementation to do its own merging. */
|
||||
public void merge(MergeState mergeState, Fields fields) throws IOException {
|
||||
for (String field : fields) {
|
||||
mergeState.fieldInfo = mergeState.fieldInfos.fieldInfo(field);
|
||||
assert mergeState.fieldInfo != null : "FieldInfo for field is null: "+ field;
|
||||
FieldInfo info = mergeState.fieldInfos.fieldInfo(field);
|
||||
assert info != null : "FieldInfo for field is null: "+ field;
|
||||
Terms terms = fields.terms(field);
|
||||
if (terms != null) {
|
||||
final TermsConsumer termsConsumer = addField(mergeState.fieldInfo);
|
||||
termsConsumer.merge(mergeState, terms.iterator(null));
|
||||
final TermsConsumer termsConsumer = addField(info);
|
||||
termsConsumer.merge(mergeState, info.getIndexOptions(), terms.iterator(null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,12 +73,11 @@ public abstract class PostingsConsumer {
|
|||
|
||||
/** Default merge impl: append documents, mapping around
|
||||
* deletes */
|
||||
public TermStats merge(final MergeState mergeState, final DocsEnum postings, final FixedBitSet visitedDocs) throws IOException {
|
||||
public TermStats merge(final MergeState mergeState, IndexOptions indexOptions, final DocsEnum postings, final FixedBitSet visitedDocs) throws IOException {
|
||||
|
||||
int df = 0;
|
||||
long totTF = 0;
|
||||
|
||||
IndexOptions indexOptions = mergeState.fieldInfo.getIndexOptions();
|
||||
if (indexOptions == IndexOptions.DOCS_ONLY) {
|
||||
while(true) {
|
||||
final int doc = postings.nextDoc();
|
||||
|
|
|
@ -83,7 +83,7 @@ public abstract class TermsConsumer {
|
|||
private MappingMultiDocsAndPositionsEnum postingsEnum;
|
||||
|
||||
/** Default merge impl */
|
||||
public void merge(MergeState mergeState, TermsEnum termsEnum) throws IOException {
|
||||
public void merge(MergeState mergeState, IndexOptions indexOptions, TermsEnum termsEnum) throws IOException {
|
||||
|
||||
BytesRef term;
|
||||
assert termsEnum != null;
|
||||
|
@ -92,7 +92,6 @@ public abstract class TermsConsumer {
|
|||
long sumDFsinceLastAbortCheck = 0;
|
||||
FixedBitSet visitedDocs = new FixedBitSet(mergeState.segmentInfo.getDocCount());
|
||||
|
||||
IndexOptions indexOptions = mergeState.fieldInfo.getIndexOptions();
|
||||
if (indexOptions == IndexOptions.DOCS_ONLY) {
|
||||
if (docsEnum == null) {
|
||||
docsEnum = new MappingMultiDocsEnum();
|
||||
|
@ -108,7 +107,7 @@ public abstract class TermsConsumer {
|
|||
if (docsEnumIn != null) {
|
||||
docsEnum.reset(docsEnumIn);
|
||||
final PostingsConsumer postingsConsumer = startTerm(term);
|
||||
final TermStats stats = postingsConsumer.merge(mergeState, docsEnum, visitedDocs);
|
||||
final TermStats stats = postingsConsumer.merge(mergeState, indexOptions, docsEnum, visitedDocs);
|
||||
if (stats.docFreq > 0) {
|
||||
finishTerm(term, stats);
|
||||
sumTotalTermFreq += stats.docFreq;
|
||||
|
@ -136,7 +135,7 @@ public abstract class TermsConsumer {
|
|||
assert docsAndFreqsEnumIn != null;
|
||||
docsAndFreqsEnum.reset(docsAndFreqsEnumIn);
|
||||
final PostingsConsumer postingsConsumer = startTerm(term);
|
||||
final TermStats stats = postingsConsumer.merge(mergeState, docsAndFreqsEnum, visitedDocs);
|
||||
final TermStats stats = postingsConsumer.merge(mergeState, indexOptions, docsAndFreqsEnum, visitedDocs);
|
||||
if (stats.docFreq > 0) {
|
||||
finishTerm(term, stats);
|
||||
sumTotalTermFreq += stats.totalTermFreq;
|
||||
|
@ -162,7 +161,7 @@ public abstract class TermsConsumer {
|
|||
postingsEnum.reset(postingsEnumIn);
|
||||
|
||||
final PostingsConsumer postingsConsumer = startTerm(term);
|
||||
final TermStats stats = postingsConsumer.merge(mergeState, postingsEnum, visitedDocs);
|
||||
final TermStats stats = postingsConsumer.merge(mergeState, indexOptions, postingsEnum, visitedDocs);
|
||||
if (stats.docFreq > 0) {
|
||||
finishTerm(term, stats);
|
||||
sumTotalTermFreq += stats.totalTermFreq;
|
||||
|
@ -189,7 +188,7 @@ public abstract class TermsConsumer {
|
|||
postingsEnum.reset(postingsEnumIn);
|
||||
|
||||
final PostingsConsumer postingsConsumer = startTerm(term);
|
||||
final TermStats stats = postingsConsumer.merge(mergeState, postingsEnum, visitedDocs);
|
||||
final TermStats stats = postingsConsumer.merge(mergeState, indexOptions, postingsEnum, visitedDocs);
|
||||
if (stats.docFreq > 0) {
|
||||
finishTerm(term, stats);
|
||||
sumTotalTermFreq += stats.totalTermFreq;
|
||||
|
|
|
@ -217,10 +217,6 @@ public class MergeState {
|
|||
/** InfoStream for debugging messages. */
|
||||
public InfoStream infoStream;
|
||||
|
||||
/** Current field being merged. */
|
||||
// nocommit shouldn't this be ... a param?:
|
||||
public FieldInfo fieldInfo;
|
||||
|
||||
// TODO: get rid of this? it tells you which segments are 'aligned' (e.g. for bulk merging)
|
||||
// but is this really so expensive to compute again in different components, versus once in SM?
|
||||
|
||||
|
|
Loading…
Reference in New Issue