If you search on the parents and want to match child documents, I think you want {!child} and not {!parent} in your queries or filters.
fq={!child of=...}date_query_on_parents fq=child_prop:X For this specific example, you don't even need the block-join support in facets since the base domain (query+filters) will already be the child docs you want to facet over. -Yonik On Fri, Dec 11, 2015 at 11:46 AM, Yago Riveiro <yago.rive...@gmail.com> wrote: > Hi, > > How the json facet api works with domains and facet functions? > > I try to google some info and I do not find nothing useful. > > How can do a query that find all parents that match a clause (a date) and > calculate the avg price of all of children that have property X? > > Following yonik's blog example I try something like this: > > http://localhost:8983/solr/query?q={!parent > which="parent_type:ecommerce"}date:2015-12-11T00:00:00Z&json.facet={x:'avg(price)', > domain: { blockChildren : "parent_type:ecommerce"}} > > but doesn't work. > > > > ----- > Best regards > -- > View this message in context: > http://lucene.472066.n3.nabble.com/How-Json-facet-API-works-with-domains-and-facet-functions-tp4244907.html > Sent from the Solr - User mailing list archive at Nabble.com.