[Console] Fixes Autocomplete/Suggestion for geo_* queries. (#115348) (#118841)

* Autostuggestion for geo_* added...

* Autostuggestion for geo_* added

* Fixes Autocomplete/Suggestion for geo_* queries

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: vladpro25 <91911546+vladpro25@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2021-11-17 05:49:37 -05:00 committed by GitHub
parent de609805fc
commit 7965e4581a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 6 deletions

View file

@ -79,16 +79,12 @@ filters.geo_bounding_box = {
filters.geo_distance = {
__template: {
distance: 100,
distance_unit: 'km',
FIELD: {
lat: 40.73,
lon: -74.1,
},
},
distance: 100,
distance_unit: {
__one_of: ['km', 'miles'],
},
distance_type: {
__one_of: ['arc', 'plane'],
},

View file

@ -652,11 +652,61 @@ export const query = (specService: SpecDefinitionsService) => {
},
geo_shape: {
__template: {
location: {},
relation: 'within',
FIELD: {
shape: {
type: 'envelope',
coordinates: [
[-45, 45],
[45, -45],
],
},
relation: 'within',
},
},
__scope_link: '.filter.geo_shape',
},
geo_bounding_box: {
__template: {
FIELD: {
top_left: {
lat: 40.73,
lon: -74.1,
},
bottom_right: {
lat: 40.717,
lon: -73.99,
},
},
},
__scope_link: '.filter.geo_bounding_box',
},
geo_distance: {
__template: {
distance: 100,
FIELD: {
lat: 40.73,
lon: -74.1,
},
},
__scope_link: '.filter.geo_distance',
},
geo_polygon: {
__template: {
FIELD: {
points: [
{
lat: 40.73,
lon: -74.1,
},
{
lat: 40.83,
lon: -75.1,
},
],
},
},
__scope_link: '.filter.geo_polygon',
},
// js hint gets confused here
/* jshint -W015 */
function_score: _.defaults(