java - Elasticsearch return nested objects without their parents -
i have index looks 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 querying index through java client. query, don't care authors; want books. instance, find books word "hello" in title , in first sentence.
currently, use nested query returns list of authors, , manually parse list books. there way elasticsearch directly return list of books? using elasticsearch version 1.5.2, , jest 0.1.6
no, results documents inject. can use source filtering limit fields of documents returned, way can nested docs. these in scope of nested parent. if find 2 authors each few books, 2 results nested docs in there.
Comments
Post a Comment