Yogesh_BG
(Yogesh BG)
October 16, 2017, 7:45am
1
Hi
I have doc like below
doc1:
"url":{
"http://hello.com":10,
"http://hello2.com":20,
}
doc2:
"url":{
"http://hello3.com":10,
"http://hello2.com":20,
"http://hello4.com":10,
"http://hello6.com":20
}
I want to group by fields under url[in my case url is a nested field]
The result should be combined as below...
which actually matches the url and sum the count
doc1:
"url":{
"http://hello.com":10,
"http://hello2.com":40,
"http://hello3.com":10,
"http://hello4.com":10,
"http://hello6.com":20
}
Basically i dont know what are the fields present inside the url's...
Is there a way to get aggregation like this?
dadoonet
(David Pilato)
October 16, 2017, 8:09am
2
You are going to produce a lot of fields in the mapping and may be hit soon the default 1000 fields in mapping.
May be a key/value approach would be better?
It will then make that easier to build an aggregation on.
Yogesh_BG
(Yogesh BG)
October 16, 2017, 8:52am
3
can you give me an example?
I had kept url as key and count as value...
dadoonet
(David Pilato)
October 16, 2017, 10:26am
4
Did you change the document form? Or still using initial structure?
If the later, I don’t know how you can do it. May be with this? https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping-field-names-field.html
system
(system)
Closed
November 13, 2017, 10:26am
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.