I have an index that looks like this:
{
"mappings":{
"authors":{
"properties":{
"books":{
"type":"nested",
"properties":{
"title":{"type":"string"},
"firstSentence":{"type":"string"},
"isbn":{"type":"string"},
"publishDate":{"type":"date"},
}
},
"firstName":{"type":"string"},
"lastName":{"type":"string"},
"birthday":{"type":"date"},
}
}
}
I am querying this index through a Java client. For this query, I don't care about the authors; all I want to get back are books. For instance, I would like to find all books with the word "Hello" in the title and in the first sentence.
Currently, I use a nested query that returns a list of authors, and then I manually parse that list to get the books. Is there a way to get Elasticsearch to directly return a list of books? I am using Elasticsearch version 1.5.2, and Jest 0.1.6