Oh... and btw, I think the readability of the JSON will be less and less important going forward. Queries will grow in size anyway (due to nested facets) and the ability to quickly validate the query using some parser will be more useful and practical than relying on human eye doing the check instead.
I assume that both the ES and Solr will end up having some higher level language for people to express queries and facets/aggregations in readable form (anyone remember SQL?) and this will be transformed to JSON (or other native) format down the road. In my opinion the most important thing for any non-trivial JSON based language format now is to make sure it is parser friendly and grammars can be defined easily for it. On Sun, Apr 19, 2015 at 8:09 AM, Lukáš Vlček <lukas.vl...@gmail.com> wrote: > Late here but let me add one more thing: IIRC the recommendation for JSON > is to never use data as a key in objects. One of the benefits of not using > data as a keys in JSON is easier validation using JSON schema. If one wants > to validate JSON query for Elasticsearch today it is necessary to implement > custom parser (and grammar first of course). > > Lukas > > On Sat, Apr 18, 2015 at 11:46 PM, Yonik Seeley <ysee...@gmail.com> wrote: > >> Alther minor benefit to the flatter structure means that the "smart >> merging" of multiple JSON parameters works a little better in >> conjunction with facets. >> >> For example, if you already had a "top_genre" facet, you could insert >> a "top_author" facet more easily: >> >> json.facet.top_genre.facet.top_author={type:terms, field:author, limit:5} >> >> (For anyone who doesn't know what "smart merging" is, see >> http://yonik.com/solr-json-request-api/ ) >> >> -Yonik >> >> >> On Sat, Apr 18, 2015 at 11:36 AM, Yonik Seeley <ysee...@gmail.com> wrote: >> > Thank you everyone for the feedback! >> > >> > I've implemented and committed the flatter structure: >> > https://issues.apache.org/jira/browse/SOLR-7422 >> > So either form can now be used (and I'll be switching to the flatter >> > method for examples when it actually reduces the levels). >> > >> > For those who want to try it out, I just made a 5.2-dev snapshot: >> > https://github.com/yonik/lucene-solr/releases >> > >> > -Yonik >> > >