Search in sources :

Example 1 with LeafGeoPointFieldData

use of org.opensearch.index.fielddata.LeafGeoPointFieldData in project OpenSearch by opensearch-project.

the class GeoEmptyValueSource method getValues.

@Override
public DoubleValues getValues(LeafReaderContext leaf, DoubleValues scores) {
    LeafGeoPointFieldData leafData = (LeafGeoPointFieldData) fieldData.load(leaf);
    final MultiGeoPointValues values = leafData.getGeoPointValues();
    return new DoubleValues() {

        @Override
        public double doubleValue() {
            return 1;
        }

        @Override
        public boolean advanceExact(int doc) throws IOException {
            return values.advanceExact(doc);
        }
    };
}
Also used : DoubleValues(org.apache.lucene.search.DoubleValues) MultiGeoPointValues(org.opensearch.index.fielddata.MultiGeoPointValues) LeafGeoPointFieldData(org.opensearch.index.fielddata.LeafGeoPointFieldData)

Example 2 with LeafGeoPointFieldData

use of org.opensearch.index.fielddata.LeafGeoPointFieldData in project OpenSearch by opensearch-project.

the class GeoLongitudeValueSource method getValues.

@Override
public DoubleValues getValues(LeafReaderContext leaf, DoubleValues scores) {
    LeafGeoPointFieldData leafData = (LeafGeoPointFieldData) fieldData.load(leaf);
    final MultiGeoPointValues values = leafData.getGeoPointValues();
    return new DoubleValues() {

        @Override
        public double doubleValue() throws IOException {
            return values.nextValue().getLon();
        }

        @Override
        public boolean advanceExact(int doc) throws IOException {
            return values.advanceExact(doc);
        }
    };
}
Also used : DoubleValues(org.apache.lucene.search.DoubleValues) MultiGeoPointValues(org.opensearch.index.fielddata.MultiGeoPointValues) LeafGeoPointFieldData(org.opensearch.index.fielddata.LeafGeoPointFieldData)

Example 3 with LeafGeoPointFieldData

use of org.opensearch.index.fielddata.LeafGeoPointFieldData in project OpenSearch by opensearch-project.

the class GeoLatitudeValueSource method getValues.

@Override
public DoubleValues getValues(LeafReaderContext leaf, DoubleValues scores) {
    LeafGeoPointFieldData leafData = (LeafGeoPointFieldData) fieldData.load(leaf);
    final MultiGeoPointValues values = leafData.getGeoPointValues();
    return new DoubleValues() {

        @Override
        public double doubleValue() throws IOException {
            return values.nextValue().getLat();
        }

        @Override
        public boolean advanceExact(int doc) throws IOException {
            return values.advanceExact(doc);
        }
    };
}
Also used : DoubleValues(org.apache.lucene.search.DoubleValues) MultiGeoPointValues(org.opensearch.index.fielddata.MultiGeoPointValues) LeafGeoPointFieldData(org.opensearch.index.fielddata.LeafGeoPointFieldData)

Aggregations

DoubleValues (org.apache.lucene.search.DoubleValues)3 LeafGeoPointFieldData (org.opensearch.index.fielddata.LeafGeoPointFieldData)3 MultiGeoPointValues (org.opensearch.index.fielddata.MultiGeoPointValues)3