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
2c75593c
Commit
2c75593c
authored
Jun 08, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring: elasticsearch raw doc size limit option PR, #8527
parent
3c41d047
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
public/app/plugins/datasource/elasticsearch/query_builder.js
+6
-7
public/app/plugins/datasource/elasticsearch/specs/datasource_specs.ts
+1
-1
No files found.
public/app/plugins/datasource/elasticsearch/query_builder.js
View file @
2c75593c
...
@@ -110,7 +110,7 @@ function (queryDef) {
...
@@ -110,7 +110,7 @@ function (queryDef) {
};
};
ElasticQueryBuilder
.
prototype
.
documentQuery
=
function
(
query
,
size
)
{
ElasticQueryBuilder
.
prototype
.
documentQuery
=
function
(
query
,
size
)
{
query
.
size
=
size
===
undefined
?
500
:
size
;
query
.
size
=
size
;
query
.
sort
=
{};
query
.
sort
=
{};
query
.
sort
[
this
.
timeField
]
=
{
order
:
'desc'
,
unmapped_type
:
'boolean'
};
query
.
sort
[
this
.
timeField
]
=
{
order
:
'desc'
,
unmapped_type
:
'boolean'
};
...
@@ -193,13 +193,12 @@ function (queryDef) {
...
@@ -193,13 +193,12 @@ function (queryDef) {
// handle document query
// handle document query
if
(
target
.
bucketAggs
.
length
===
0
)
{
if
(
target
.
bucketAggs
.
length
===
0
)
{
metric
=
target
.
metrics
[
0
];
metric
=
target
.
metrics
[
0
];
if
(
metric
&&
metric
.
type
!==
'raw_document'
)
{
if
(
!
metric
||
metric
.
type
!==
'raw_document'
)
{
target
.
bucketAggs
=
[{
type
:
'date_histogram'
,
id
:
'2'
,
settings
:
{
interval
:
'auto'
}}];
throw
{
message
:
'Invalid query'
};
}
else
{
var
size
=
metric
&&
metric
.
hasOwnProperty
(
"settings"
)
&&
metric
.
settings
.
hasOwnProperty
(
"size"
)
&&
metric
.
settings
[
"size"
]
!==
null
?
metric
.
settings
[
"size"
]
:
500
;
return
this
.
documentQuery
(
query
,
size
);
}
}
var
size
=
(
metric
.
settings
&&
metric
.
settings
.
size
)
||
500
;
return
this
.
documentQuery
(
query
,
size
);
}
}
nestedAggs
=
query
;
nestedAggs
=
query
;
...
...
public/app/plugins/datasource/elasticsearch/specs/datasource_specs.ts
View file @
2c75593c
...
@@ -62,7 +62,7 @@ describe('ElasticDatasource', function() {
...
@@ -62,7 +62,7 @@ describe('ElasticDatasource', function() {
from
:
moment
.
utc
([
2015
,
4
,
30
,
10
]),
from
:
moment
.
utc
([
2015
,
4
,
30
,
10
]),
to
:
moment
.
utc
([
2015
,
5
,
1
,
10
])
to
:
moment
.
utc
([
2015
,
5
,
1
,
10
])
},
},
targets
:
[{
bucketAggs
:
[],
metrics
:
[],
query
:
'escape
\\
:test'
}]
targets
:
[{
bucketAggs
:
[],
metrics
:
[
{
type
:
'raw_document'
}
],
query
:
'escape
\\
:test'
}]
});
});
ctx
.
$rootScope
.
$apply
();
ctx
.
$rootScope
.
$apply
();
...
...
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