I must be missing something simple here, but I'm having trouble getting the JSON Facet API to work at all. Today, I took a Solr 4.10.2 installation and swapped it out for HS 0.09. Everything works at first blush - searching, my custom URPs and search components, etc. However, I'm stuck moving from the Solr facet approach to the JSON approach.
For example, a standard Solr facet on field "language" can be returned using:
The response contains the facets I expect:
{
"responseHeader":{
"status":0,
"QTime":17,
"params":{
"facet":"true",
"q":"*:*",
"facet.field":"language",
"rows":"0"}},
"response":{"numFound":727709,"start":0,"maxScore":1.0,"docs":[]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"language":[
"en",727514,
[... abbreviated ]
"facet_dates":{},
"facet_ranges":{},
"facet_intervals":{}}}
-------------------------
Now I try the JSON API in the simple Terms Facet format, according to the guide:
json.facet={
lang : { terms : language }
}
'
For this or several other variations, the response contains no facets:
{
"responseHeader":{
"status":0,
"QTime":13,
"params":{
"q":"*:*",
"json.facet":"{\nlanguage : { terms : { field : language } }\n}\n",
"rows":"0"}},
"response":{"numFound":727709,"start":0,"maxScore":1.0,"docs":[]
}}
No errors in the logs. Tried issuing these requests via BASH scripts and other ways - no dice. If I purposely malform the JSON, I get a Noggit JSON error so I know it's parsing it. If I add "facet=true" to the request, I get an empty "facet_counts" block.