@Override public boolean advanceExact(int doc) throws IOException { return values.advanceExact(doc); } @Override
@Override public boolean advanceExact(int doc) throws IOException { return pointValues.advanceExact(doc); } };
@Override public boolean advanceExact(int doc) throws IOException { if (values.advanceExact(doc)) { count = values.docValueCount(); } else { count = 0; } // always return true because we want to return a value even if // the document does not have a value return true; }
@Override protected String getDistanceString(LeafReaderContext ctx, int docId) throws IOException { StringBuilder values = new StringBuilder(mode.name()); values.append(" of: ["); final MultiGeoPointValues geoPointValues = fieldData.load(ctx).getGeoPointValues(); if (geoPointValues.advanceExact(docId)) { final int num = geoPointValues.docValueCount(); for (int i = 0; i < num; i++) { GeoPoint value = geoPointValues.nextValue(); values.append("Math.max(arcDistance("); values.append(value).append("(=doc value),"); values.append(origin).append("(=origin)) - ").append(offset).append("(=offset), 0)"); if (i != num - 1) { values.append(", "); } } } else { values.append("0.0"); } values.append("]"); return values.toString(); }
@Override public void setNextDocId(int docId) throws IOException { if (in.advanceExact(docId)) { resize(in.docValueCount()); for (int i = 0; i < count; i++) { GeoPoint point = in.nextValue(); values[i] = new GeoPoint(point.lat(), point.lon()); } } else { resize(0); } }
@Override public boolean advanceExact(int docId) throws IOException { if (geoPointValues.advanceExact(docId)) { int n = geoPointValues.docValueCount(); resize(n); for (int i = 0; i < n; i++) { GeoPoint other = geoPointValues.nextValue(); double distance = distFunction.calculate( origin.lat(), origin.lon(), other.lat(), other.lon(), DistanceUnit.METERS); values[i] = Math.max(0.0d, distance - offset); } sort(); return true; } else { return false; } } }), 0);
@Override public double doubleVal(int doc) throws IOException { if (values.advanceExact(doc)) { return 1; } else { return 0; } } };
@Override public boolean advanceExact(int docId) throws IOException { if (geoValues.advanceExact(docId)) { resize(geoValues.docValueCount()); for (int i = 0; i < docValueCount(); ++i) { GeoPoint target = geoValues.nextValue(); values[i] = GeoHashUtils.longEncode(target.getLon(), target.getLat(), precision); } sort(); return true; } else { return false; } } }
@Override public boolean advanceExact(int doc) throws IOException { return values.advanceExact(doc); } @Override
@Override public boolean advanceExact(int doc) throws IOException { return pointValues.advanceExact(doc); } };
@Override public boolean advanceExact(int doc) throws IOException { return pointValues.advanceExact(doc); } };
@Override public boolean advanceExact(int target) throws IOException { if (geoPointValues.advanceExact(target)) { resize(geoPointValues.docValueCount() * fromPoints.length); int v = 0; for (int i = 0; i < geoPointValues.docValueCount(); ++i) { final GeoPoint point = geoPointValues.nextValue(); for (GeoPoint from : fromPoints) { values[v] = distance.calculate(from.lat(), from.lon(), point.lat(), point.lon(), unit); v++; } } sort(); return true; } else { return false; } } };
counts = bigArrays.grow(counts, bucket + 1); if (values.advanceExact(doc)) { final int valueCount = values.docValueCount(); double[] pt = new double[2];
@Override public boolean advanceExact(int doc) throws IOException { if (values.advanceExact(doc)) { count = values.docValueCount(); } else { count = 0; } // always return true because we want to return a value even if // the document does not have a value return true; }
@Override public boolean advanceExact(int doc) throws IOException { if (values.advanceExact(doc)) { count = values.docValueCount(); } else { count = 0; } // always return true because we want to return a value even if // the document does not have a value return true; }
@Override public double doubleVal(int doc) throws IOException { if (values.advanceExact(doc)) { return values.nextValue().getLat(); } else { return 0.0; } } };
@Override public double doubleVal(int doc) throws IOException { if (values.advanceExact(doc)) { return values.nextValue().getLon(); } else { return 0.0; } } };
@Override public void setNextDocId(int docId) throws IOException { if (in.advanceExact(docId)) { resize(in.docValueCount()); for (int i = 0; i < count; i++) { GeoPoint point = in.nextValue(); values[i] = new GeoPoint(point.lat(), point.lon()); } } else { resize(0); } }
@Override public void setNextDocId(int docId) throws IOException { if (in.advanceExact(docId)) { resize(in.docValueCount()); for (int i = 0; i < count; i++) { GeoPoint point = in.nextValue(); values[i] = new GeoPoint(point.lat(), point.lon()); } } else { resize(0); } }
if (values.advanceExact(doc)) { final int valuesCount = values.docValueCount();