1 package org.apache.lucene.index;
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership.
7 * The ASF licenses this file to You under the Apache License, Version 2.0
8 * (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 import java.io.IOException;
22 import org.apache.lucene.index.PayloadProcessorProvider.DirPayloadProcessor;
24 final class SegmentMergeInfo {
27 int ord; // the position of the segment in a MultiReader
31 private TermPositions postings; // use getPositions()
32 private int[] docMap; // use getDocMap()
33 DirPayloadProcessor dirPayloadProcessor;
35 SegmentMergeInfo(int b, TermEnum te, IndexReader r)
43 // maps around deleted docs
47 // build array which maps document numbers around deletions
48 if (reader.hasDeletions()) {
49 int maxDoc = reader.maxDoc();
50 docMap = new int[maxDoc];
52 for (int i = 0; i < maxDoc; i++) {
53 if (reader.isDeleted(i)) {
64 TermPositions getPositions() throws IOException {
65 if (postings == null) {
66 postings = reader.termPositions();
71 final boolean next() throws IOException {
72 if (termEnum.next()) {
73 term = termEnum.term();
81 final void close() throws IOException {
85 if (postings != null) {