I've finally solved this problem. It appears that I do not need to add the line domain: blockChildren: content_type:c in the subfacet. Now I've got my desired results
On Tue, Apr 26, 2016 at 3:14 PM, Yangrui Guo <guoyang...@gmail.com> wrote: > The documents are organized in a key-value like structure > > { > id: 1 > product_name: some apparel > category: apparel > { > attribute: brand > value: Chanel > } > { > attribute: madein > value: Europe > } > } > > Because there are indefinite numbers of attributes associated with the > products, I used this structure to store the document. My intention is to > show facets of the value when an attribute facet is chosen. For example, if > you choose "brand" then it'll show "Chanel", "Dior", etc. Is this currently > possible? > > Yangrui Guo > > > On Tuesday, April 26, 2016, Yonik Seeley <ysee...@gmail.com> wrote: > >> How are the documents indexed? Can you show an example document (with >> nested documents)? >> -Yonik >> >> >> On Tue, Apr 26, 2016 at 5:08 PM, Yangrui Guo <guoyang...@gmail.com> >> wrote: >> > When I use subfaceting with Json API, the facet results only gave me >> > counts, no terms. My query is like this: >> > >> > { >> > apparels : { >> > type: terms, >> > field: brand, >> > facet:{ >> > values:{ >> > type: query, >> > q:\"brand:Chanel\", >> > facet: { >> > type: terms, >> > field: madein >> > } >> > domain: { blockChildren : \"content_type:p\" } >> > } >> > }, >> > domain: { blockChildren : \"content_type:p\" } >> > } >> > } >> > } >> > >> > And this is the results that I got: >> > >> > facets={ >> > count=57477, >> > apparels={ >> > buckets= >> > { >> > val=Chanel, >> > count=6, >> > madein={ >> > count=6 >> > >> > buckets={} >> > } >> > } >> > } >> > } >> > >> > The second buckets got zero results but the count was correct. What was >> I >> > missing? Thanks so much! >> >