I want to filter children in elastic search without changing the parent node, i have something like this data, and want to all games, but only "isVisible = true" members should appear with each game
{
"_index": "test",
"_type": "Game",
"_id": "1",
"_source": {
"gameName" : "test game",
"teamMembers" : {
"id" : "2",
"name":"John",
"isVisible" : true
},
{
"id" : "3",
"name":"emma",
"isVisible": false
}
} }
So, i want to get the above game as is but with only 1 team member (John) i am using C#, and tried this:
var result = new List<Func<QueryContainerDescriptor<Review>, QueryContainer>>();
result.Add(a => a.Nested(n => n.Path("teamMembers").Query(q => q.Match(m => m.Field("teamMembers.isVisible").Query("true")))));
but it didn't work.
Note: i am using Elastic search 5.4
Thanks in advanced.