child document faceting returning empty buckets

2015-11-09 Thread Yangrui Guo
Hello

I followed Yonik's blog regarding faceting on child document and my curl
command is posted below:

curl http://localhost:8983/solr/movie_shard1_replica1/query -d '
q={!parent which="content_type:parent"}+movie&
json.facet={
movies:{
type:terms,
field:actor,
domain:{blockChildren:"content_type:children"}
}
}'

But I got an empty list of buckets from the response. The count number was
equivalent to number of parent docs. Is there anything wrong with my query?

 "facets":{
"count":2412762,
"movies":{
  "buckets":[]}}}

Yangrui Guo


Re: child document faceting returning empty buckets

2015-11-09 Thread Yonik Seeley
On Mon, Nov 9, 2015 at 7:30 PM, Yangrui Guo  wrote:
> Just solved the problem by changing blockChildren:"content_type:children"
> to blockParent:"content_type:children".

Unless you're dealing with multiple levels, you may be using the wrong
content_type value.
That query should always define the full set of parents for both
blockChildren and blockParents.

-Yonik


Re: child document faceting returning empty buckets

2015-11-09 Thread Yangrui Guo
Just solved the problem by changing blockChildren:"content_type:children"
to blockParent:"content_type:children". Does Solrj support json faceting as
well?

Yangrui

On Mon, Nov 9, 2015 at 2:39 PM, Yangrui Guo  wrote:

> Hello
>
> I followed Yonik's blog regarding faceting on child document and my curl
> command is posted below:
>
> curl http://localhost:8983/solr/movie_shard1_replica1/query -d '
> q={!parent which="content_type:parent"}+movie&
> json.facet={
> movies:{
> type:terms,
> field:actor,
> domain:{blockChildren:"content_type:children"}
> }
> }'
>
> But I got an empty list of buckets from the response. The count number was
> equivalent to number of parent docs. Is there anything wrong with my query?
>
>  "facets":{
> "count":2412762,
> "movies":{
>   "buckets":[]}}}
>
> Yangrui Guo
>