Jack Miller Jack Miller - 2 months ago 15
JSON Question

Solr: Group via JSON request via HTTP POST

I am trying to use Solr's

result grouping
by posting JSON formatted query to the
request handler (e.g. via the
tab in Solr's admin UI; use set request handler to

The query is simple:


All samples I found use HTTP GET, e.g.:


When I try to add JSON field
or something, the error message is always the same:

Unknown top-level key in JSON request : group...

I am aware of the approach provided here: POST json request to Solr with cursorMark in request (post url-encoded data instead of JSON). However, I'd like to avoid that. Any ideas how it can be done?

Answer Source

What I am looking for is the JSON Request API. Unfortunately, it seems that it is discontinued. In October 2016 Yonik wrote: "The JSON Request API is currently in it’s infancy – only a few query parameters are supported". The latest official documentation about the API is from 2015: https://cwiki.apache.org/confluence/display/solr/JSON+Request+API (and was also created by someone called Yonik. Coincidence?!) But it is not mentioned in the current reference guides Apache Solr 6.5/6.6.

So the answer is: Result grouping cannot be accessed via a JSON query. Note: Same is true for the more current Collapse and Expand components.