You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add geo_bounding_box and geo_distance
Signed-off-by: xil <fridalu66@gmail.com>
* fix field number
Signed-off-by: xil <fridalu66@gmail.com>
* Add comment
Signed-off-by: xil <fridalu66@gmail.com>
* Add more doc
Signed-off-by: xil <fridalu66@gmail.com>
---------
Signed-off-by: xil <fridalu66@gmail.com>
Signed-off-by: Karen X <karenxyr@gmail.com>
Co-authored-by: Karen X <karenxyr@gmail.com>
Copy file name to clipboardExpand all lines: protos/schemas/common.proto
+112-7Lines changed: 112 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -137,13 +137,23 @@ enum SourceType {
137
137
}
138
138
139
139
messageGeoLocation {
140
-
141
140
oneofgeo_location {
142
-
LatLonGeoLocationlat_lon_geo_location=1;
143
-
GeoHashLocationgeo_hash_location=2;
144
-
NumberArraynumber_array=3;
141
+
// The location specified using latitude and longitude coordinates.
142
+
LatLonGeoLocationlatlon=1;
143
+
144
+
// The location specified using a geohash value.
145
+
GeoHashLocationgeohash=2;
146
+
147
+
DoubleArraydouble_array=3;
148
+
149
+
// The location specified as a string in `lat,lon` or WKT format.
150
+
stringtext=4;
145
151
}
152
+
}
146
153
154
+
messageDoubleArray {
155
+
// The location specified as an array of `[longitude, latitude]`.
156
+
repeateddoubledouble_array=1;
147
157
}
148
158
149
159
messageNumberArray {
@@ -153,16 +163,16 @@ message NumberArray {
153
163
}
154
164
155
165
messageLatLonGeoLocation {
156
-
// Latitude
166
+
// [required] Latitude
157
167
doublelat=1;
158
168
159
-
// Longitude
169
+
// [required] Longitude
160
170
doublelon=2;
161
171
162
172
}
163
173
164
174
messageGeoHashLocation {
165
-
175
+
// [required]
166
176
stringgeohash=1;
167
177
168
178
}
@@ -456,9 +466,104 @@ message QueryContainer {
456
466
457
467
// The nested query acts as a wrapper for other queries to search nested fields. The nested field objects are searched as though they were indexed as separate documents. If an object matches the search, the nested query returns the parent document at the root level.
458
468
NestedQuerynested=28;
469
+
470
+
// A geodistance query returns documents with geopoints that are within a specified distance from the provided geopoint. A document with multiple geopoints matches the query if at least one geopoint matches the query.
471
+
GeoDistanceQuerygeo_distance=29;
472
+
473
+
// To search for documents that contain geopoint fields, use a geo-bounding box query. The geo-bounding box query returns documents whose geopoints are within the bounding box specified in the query. A document with multiple geopoints matches the query if at least one geopoint is within the bounding box.
474
+
GeoBoundingBoxQuerygeo_bounding_box=30;
475
+
}
476
+
}
477
+
478
+
messageGeoBoundingBoxQuery {
479
+
// [optional] Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.
480
+
optionalfloatboost=1;
481
+
// [optional] The name of the filter.
482
+
optionalstringx_name=2;
483
+
// [optional]
484
+
optionalGeoExecutiontype=3;
485
+
// [optional] The validation method. Valid values are IGNORE_MALFORMED (accept geopoints with invalid coordinates), COERCE (try to coerce coordinates to valid values), and STRICT (return an error when coordinates are invalid). Default is STRICT.
486
+
optionalGeoValidationMethodvalidation_method=4;
487
+
// [optional] Specifies whether to ignore an unmapped field. If set to true, the query does not return any documents that have an unmapped field. If set to false, an exception is thrown when the field is unmapped. Default is false.
488
+
optionalboolignore_unmapped=5;
489
+
// [optional]
490
+
map<string, GeoBounds> bounding_box=6;
491
+
}
492
+
493
+
messageGeoBounds {
494
+
oneofgeo_bounds {
495
+
// The bounds specified using coordinate values.
496
+
CoordsGeoBoundscoords=1;
497
+
498
+
// The bounds specified using upper-left and lower-right points.
499
+
TopLeftBottomRightGeoBoundstlbr=2;
500
+
501
+
// The bounds specified using upper-right and lower-left points.
502
+
TopRightBottomLeftGeoBoundstrbl=3;
503
+
504
+
// The bounds specified using WKT format.
505
+
WktGeoBoundswkt=4;
459
506
}
460
507
}
461
508
509
+
messageWktGeoBounds {
510
+
// [required] The WKT string representation of the geographical bounds.
511
+
stringwkt=1;
512
+
}
513
+
514
+
messageCoordsGeoBounds {
515
+
// [required] The top boundary latitude.
516
+
doubletop=1;
517
+
518
+
// [required] The bottom boundary latitude.
519
+
doublebottom=2;
520
+
521
+
// [required] The left boundary longitude.
522
+
doubleleft=3;
523
+
524
+
// [required] The right boundary longitude.
525
+
doubleright=4;
526
+
}
527
+
528
+
messageTopLeftBottomRightGeoBounds {
529
+
// [required] The upper-left corner coordinates.
530
+
GeoLocationtop_left=1;
531
+
532
+
// [required] The lower-right corner coordinates.
533
+
GeoLocationbottom_right=2;
534
+
}
535
+
536
+
messageTopRightBottomLeftGeoBounds {
537
+
// [required] The upper-right corner coordinates.
538
+
GeoLocationtop_right=1;
539
+
540
+
// [required] The lower-left corner coordinates.
541
+
GeoLocationbottom_left=2;
542
+
}
543
+
544
+
enumGeoExecution {
545
+
GEO_EXECUTION_UNSPECIFIED=0;
546
+
GEO_EXECUTION_INDEXED=1;
547
+
GEO_EXECUTION_MEMORY=2;
548
+
}
549
+
550
+
messageGeoDistanceQuery {
551
+
// [optional] Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.
552
+
optionalfloatboost=1;
553
+
// [optional] The name of the filter.
554
+
optionalstringx_name=2;
555
+
// [required] The distance within which to match the points. This distance is the radius of a circle centered at the specified point. For supported distance units, see Distance units.
556
+
stringdistance=3;
557
+
// [optional] Specifies how to calculate the distance. Valid values are arc or plane (faster but inaccurate for long distances or points close to the poles).
558
+
optionalGeoDistanceTypedistance_type=4;
559
+
// [optional] The validation method. Valid values are IGNORE_MALFORMED (accept geopoints with invalid coordinates), COERCE (try to coerce coordinates to valid values), and STRICT (return an error when coordinates are invalid). Default is STRICT.
560
+
optionalGeoValidationMethodvalidation_method=5;
561
+
// [optional] Set to `true` to ignore an unmapped field and not match any documents for this query. Set to `false` to throw an exception if the field is not mapped.
562
+
optionalboolignore_unmapped=6;
563
+
// [optional]
564
+
map<string, GeoLocation> location=7;
565
+
}
566
+
462
567
messageTermsQuery {
463
568
// [optional] Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.
0 commit comments