mirror of https://github.com/apache/lucene.git
LUCENE-2858: fix contrib/spatial
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene2858@1237344 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c6e848d2b1
commit
45fdfc3822
|
@ -19,7 +19,7 @@ package org.apache.lucene.spatial.geohash;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.search.FieldCache;
|
||||
import org.apache.lucene.search.FieldCache.DocTerms;
|
||||
import org.apache.lucene.search.Filter;
|
||||
|
@ -60,11 +60,11 @@ public class GeoHashDistanceFilter extends DistanceFilter {
|
|||
@Override
|
||||
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
|
||||
|
||||
final DocTerms geoHashValues = FieldCache.DEFAULT.getTerms(context.reader, geoHashField);
|
||||
final DocTerms geoHashValues = FieldCache.DEFAULT.getTerms(context.reader(), geoHashField);
|
||||
final BytesRef br = new BytesRef();
|
||||
|
||||
final int docBase = nextDocBase;
|
||||
nextDocBase += context.reader.maxDoc();
|
||||
nextDocBase += context.reader().maxDoc();
|
||||
|
||||
return new FilteredDocIdSet(startingFilter.getDocIdSet(context, acceptDocs)) {
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.lucene.index.DocsEnum;
|
||||
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.search.Filter;
|
||||
import org.apache.lucene.search.DocIdSet;
|
||||
import org.apache.lucene.search.DocIdSetIterator;
|
||||
|
@ -57,7 +57,7 @@ public class CartesianShapeFilter extends Filter {
|
|||
return new DocIdSet() {
|
||||
@Override
|
||||
public DocIdSetIterator iterator() throws IOException {
|
||||
return context.reader.termDocsEnum(acceptDocs, fieldName, bytesRef, false);
|
||||
return context.reader().termDocsEnum(acceptDocs, fieldName, bytesRef, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,11 +66,11 @@ public class CartesianShapeFilter extends Filter {
|
|||
}
|
||||
};
|
||||
} else {
|
||||
final FixedBitSet bits = new FixedBitSet(context.reader.maxDoc());
|
||||
final FixedBitSet bits = new FixedBitSet(context.reader().maxDoc());
|
||||
for (int i =0; i< sz; i++) {
|
||||
double boxId = area.get(i).doubleValue();
|
||||
NumericUtils.longToPrefixCoded(NumericUtils.doubleToSortableLong(boxId), 0, bytesRef);
|
||||
final DocsEnum docsEnum = context.reader.termDocsEnum(acceptDocs, fieldName, bytesRef, false);
|
||||
final DocsEnum docsEnum = context.reader().termDocsEnum(acceptDocs, fieldName, bytesRef, false);
|
||||
if (docsEnum == null) continue;
|
||||
// iterate through all documents
|
||||
// which have this boxId
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.lucene.spatial.tier;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.search.Filter;
|
||||
import org.apache.lucene.search.FieldComparator;
|
||||
import org.apache.lucene.search.FieldComparatorSource;
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.lucene.spatial.tier;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.search.FilteredDocIdSet;
|
||||
import org.apache.lucene.search.FieldCache;
|
||||
import org.apache.lucene.search.Filter;
|
||||
|
@ -63,11 +63,11 @@ public class LatLongDistanceFilter extends DistanceFilter {
|
|||
@Override
|
||||
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
|
||||
|
||||
final double[] latIndex = FieldCache.DEFAULT.getDoubles(context.reader, latField, false);
|
||||
final double[] lngIndex = FieldCache.DEFAULT.getDoubles(context.reader, lngField, false);
|
||||
final double[] latIndex = FieldCache.DEFAULT.getDoubles(context.reader(), latField, false);
|
||||
final double[] lngIndex = FieldCache.DEFAULT.getDoubles(context.reader(), lngField, false);
|
||||
|
||||
final int docBase = nextDocBase;
|
||||
nextDocBase += context.reader.maxDoc();
|
||||
nextDocBase += context.reader().maxDoc();
|
||||
|
||||
return new FilteredDocIdSet(startingFilter.getDocIdSet(context, acceptDocs)) {
|
||||
@Override
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.apache.lucene.document.FieldType;
|
|||
import org.apache.lucene.document.NumericField;
|
||||
import org.apache.lucene.document.TextField;
|
||||
import org.apache.lucene.index.FieldInfo.IndexOptions;
|
||||
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
import org.apache.lucene.index.Term;
|
||||
|
@ -119,7 +119,7 @@ public class TestDistance extends LuceneTestCase {
|
|||
|
||||
AtomicReaderContext[] leaves = ReaderUtil.leaves(r.getTopReaderContext());
|
||||
for (int i = 0; i < leaves.length; i++) {
|
||||
f.getDocIdSet(leaves[i], leaves[i].reader.getLiveDocs());
|
||||
f.getDocIdSet(leaves[i], leaves[i].reader().getLiveDocs());
|
||||
}
|
||||
r.close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue