Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
69c2fafa
Commit
69c2fafa
authored
Apr 28, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(elasticsearch): added geo hash bucket aggregation
parent
5a241a82
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
0 deletions
+23
-0
public/app/plugins/datasource/elasticsearch/bucket_agg.js
+11
-0
public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html
+7
-0
public/app/plugins/datasource/elasticsearch/query_builder.js
+4
-0
public/app/plugins/datasource/elasticsearch/query_def.js
+1
-0
No files found.
public/app/plugins/datasource/elasticsearch/bucket_agg.js
View file @
69c2fafa
...
...
@@ -60,6 +60,10 @@ function (angular, _, queryDef) {
$scope
.
agg
.
query
=
'*'
;
break
;
}
case
'geohash_grid'
:
{
$scope
.
agg
.
settings
.
precision
=
3
;
break
;
}
}
$scope
.
validateModel
();
...
...
@@ -121,6 +125,13 @@ function (angular, _, queryDef) {
if
(
settings
.
trimEdges
&&
settings
.
trimEdges
>
0
)
{
settingsLinkText
+=
', Trim edges: '
+
settings
.
trimEdges
;
}
break
;
}
case
'geohash_grid'
:
{
// limit precision to 7
settings
.
precision
=
Math
.
max
(
Math
.
min
(
settings
.
precision
,
7
),
1
);
settingsLinkText
=
'Precision: '
+
settings
.
precision
;
break
;
}
}
...
...
public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html
View file @
69c2fafa
...
...
@@ -86,6 +86,13 @@
</div>
</div>
<div
ng-if=
"agg.type === 'geohash_grid'"
>
<div
class=
"gf-form offset-width-7"
>
<label
class=
"gf-form-label"
>
Precision
</label>
<input
type=
"number"
class=
"gf-form-input max-width-12"
ng-model=
"agg.settings.precision"
spellcheck=
'false'
placeholder=
"3"
ng-blur=
"onChangeInternal()"
>
</div>
</div>
</div>
public/app/plugins/datasource/elasticsearch/query_builder.js
View file @
69c2fafa
...
...
@@ -153,6 +153,10 @@ function (queryDef) {
this
.
buildTermsAgg
(
aggDef
,
esAgg
,
target
);
break
;
}
case
'geohash_grid'
:
{
esAgg
[
'geohash_grid'
]
=
{
field
:
aggDef
.
field
,
precision
:
aggDef
.
settings
.
precision
};
break
;
}
}
nestedAggs
.
aggs
=
nestedAggs
.
aggs
||
{};
...
...
public/app/plugins/datasource/elasticsearch/query_def.js
View file @
69c2fafa
...
...
@@ -22,6 +22,7 @@ function (_) {
bucketAggTypes
:
[
{
text
:
"Terms"
,
value
:
'terms'
,
requiresField
:
true
},
{
text
:
"Filters"
,
value
:
'filters'
},
{
text
:
"Geo Hash Grid"
,
value
:
'geohash_grid'
,
requiresField
:
true
},
{
text
:
"Date Histogram"
,
value
:
'date_histogram'
,
requiresField
:
true
},
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment