Personally I find the second form easier to read. The second level of nesting in the first example confuses me at first glance.
I don't have a really strong preference here, but I vote for the second form. On Fri, Apr 17, 2015 at 9:20 AM, Yonik Seeley <ysee...@gmail.com> wrote: > Does anyone have any thoughts on the current general structure of JSON facets? > The current general form of a facet command is: > > <facet_name> : { <facet_type> : <facet_args> } > > For example: > > top_authors : { terms : { > field : author, > limit : 5, > }} > > One alternative I considered in the past is having the type in the args: > > top_authors : { > type : terms, > field : author, > limit : 5 > } > > It's a flatter structure... probably better in some ways, but worse in > other ways. > Thoughts / preferences? > > -Yonik > > > On Tue, Apr 14, 2015 at 4:30 PM, Yonik Seeley <ysee...@gmail.com> wrote: >> Folks, there's a new JSON Facet API in the just released Solr 5.1 >> (actually, a new facet module under the covers too). >> >> It's marked as experimental so we have time to change the API based on >> your feedback. So let us know what you like, what you would change, >> what's missing, or any other ideas you may have! >> >> I've just started the documentation for the reference guide (on our >> confluence wiki), so for now the best doc is on my blog: >> >> http://yonik.com/json-facet-api/ >> http://yonik.com/solr-facet-functions/ >> http://yonik.com/solr-subfacets/ >> >> I'll also be hanging out more on the #solr-dev IRC channel on freenode >> if you want to hit me up there about any development ideas. >> >> -Yonik