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.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-source-filtering.html#search-request-source-filtering


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -