2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 namespace Mono.Lucene.Net.Index
23 sealed class SegmentMergeInfo
26 internal int base_Renamed;
27 internal int ord; // the position of the segment in a MultiReader
28 internal TermEnum termEnum;
29 internal IndexReader reader;
30 internal int delCount;
31 private TermPositions postings; // use getPositions()
32 private int[] docMap; // use getDocMap()
34 internal SegmentMergeInfo(int b, TermEnum te, IndexReader r)
42 // maps around deleted docs
43 internal int[] GetDocMap()
48 // build array which maps document numbers around deletions
49 if (reader.HasDeletions())
51 int maxDoc = reader.MaxDoc();
52 docMap = new int[maxDoc];
54 for (int i = 0; i < maxDoc; i++)
56 if (reader.IsDeleted(i))
69 internal TermPositions GetPositions()
73 postings = reader.TermPositions();
82 term = termEnum.Term();