-
-
Save anonymous/a58e2db23e2ee39dc89c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given the following articles ( I haven't loaded the comments yet so this structure will do for illustration ): | |
{ | |
"article" : { | |
"title" : "article 1", | |
"comment" : [ | |
{ "text":"mytext1", "date": "2013-11-21", "author": "matt" }, | |
{ "text":"mytext2", "date": "2013-12-01", "author": "matt" } | |
] | |
} | |
} | |
{ | |
"article" : { | |
"title" : "article 2", | |
"comment" : [ | |
{ "text":"mytext3", "date": "2014-01-21", "author": "matt" }, | |
{ "text":"mytext4", "date": "2014-02-01", "author": "matt" } | |
] | |
} | |
} | |
I can execute a query that returns: | |
{ | |
"hits" : [ | |
{ | |
"_id" : 1, | |
"_source" : { | |
"title" : "article 1", | |
"comment" : { "text" : "mytext2", "date" : "2013-12-01" } | |
} | |
}, | |
{ | |
"_id" : 2, | |
"_source" : { | |
"title" : "article 2", | |
"comment" : { "text" : "mytext4", "date" : "2014-02-01" } | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment