MaTTaDox
(Dominik Malsch)
November 17, 2016, 3:59pm
1
Hey,
how can i filter within a nested Property without change the result count?
Hit Example:
"_index": "1000",
"_type": "example",
"_id": "1337",
"_score": 1234,
"_source": {
"id": 1337,
"texts": [
{
"name": "FooBar",
"lang": "de",
"referrer":1
},
{
"name": "FooBar",
"lang": "de",
"referrer":2
},
{
"name": "FooBar",
"lang": "en",
"referrer":1
},
But I just want certain text, filter by referrer and lang for every hit without to filter any other values of the hits.
I running on version 2.3 on AWS
Thanks helping me,
Dominik Malsch
MaTTaDox
(Dominik Malsch)
November 18, 2016, 9:11am
2
Push. Is this even possible?
jpountz
(Adrien Grand)
November 18, 2016, 9:22am
3
What does your query look like so far?
MaTTaDox
(Dominik Malsch)
November 18, 2016, 9:54am
4
I have no query so far, because i want to now this function exist.
jpountz
(Adrien Grand)
November 18, 2016, 9:58am
5
OK, got it. Then you might want to look at the nested type in the mapping.
Note that depending on your use-case, an alternative could be to denormalize your documents to look like:
{
"parent_id": 1337,
"name": "FooBar",
"lang": "de",
"referrer":1
}
And then run a cardinality aggregation to compute the number of unique parent_id
s.
system
(system)
Closed
December 16, 2016, 9:58am
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.