Re: JSON Facet & Analytics API in Solr 5.1

2015-05-10 Thread Frank li
I figured it out now. It works. "cats" just a name, right? It does not matter what is used. Really appreciate your help. This is going to be really useful. I meant "json.facet". On Sun, May 10, 2015 at 12:13 AM, Frank li wrote: > Here is our SOLR query: > > > http://qa-solr:8080/solr/select?q=t

Re: JSON Facet & Analytics API in Solr 5.1

2015-05-10 Thread Frank li
Here is our SOLR query: http://qa-solr:8080/solr/select?q=type:PortalCase&json.facet={categories:{terms:{field:campaign_id_ls,sort:%27count+asc%27}}}&rows=0 I replaced "cats" with "categories". It is still not working. On Sun, May 10, 2015 at 12:10 AM, Frank li wrote: > Thank you, Yonik! > > L

Re: JSON Facet & Analytics API in Solr 5.1

2015-05-10 Thread Frank li
Thank you, Yonik! Looks cool to me. Only problem is it is not working for me. I see you have "cats" and "cat" in your URL. "cat" must be a field name. What is "cats"? We are doing a POC with facet count ascending. You help is really important to us. On Sat, May 9, 2015 at 8:05 AM, Yonik Seeley

Re: JSON Facet & Analytics API in Solr 5.1

2015-05-09 Thread Yonik Seeley
curl -g "http://localhost:8983/solr/techproducts/query?q=*:*&json.facet={cats:{terms:{field:cat,sort:'count+asc'}}}" Using curl with everything in the URL is definitely trickier. Everything needs to be URL escaped. If it's not, curl will often silently do nothing. For example, when I had sort:'c

Re: JSON Facet & Analytics API in Solr 5.1

2015-05-08 Thread Frank li
Hi Yonik, Any update for the question? Thanks in advance, Frank On Thu, May 7, 2015 at 2:49 PM, Frank li wrote: > Is there any book to read so I won't ask such dummy questions? Thanks. > > On Thu, May 7, 2015 at 2:32 PM, Frank li wrote: > >> This one does not have problem, but how do I inclu

Re: JSON Facet & Analytics API in Solr 5.1

2015-05-07 Thread Frank li
Is there any book to read so I won't ask such dummy questions? Thanks. On Thu, May 7, 2015 at 2:32 PM, Frank li wrote: > This one does not have problem, but how do I include "sort" in this facet > query. Basically, I want to write a solr query which can sort the facet > count ascending. Somethin

Re: JSON Facet & Analytics API in Solr 5.1

2015-05-07 Thread Frank li
This one does not have problem, but how do I include "sort" in this facet query. Basically, I want to write a solr query which can sort the facet count ascending. Something like "http://localhost:8983/solr /demo/query?q=apple&json.facet={field=price sort='count asc'}

Re: JSON Facet & Analytics API in Solr 5.1

2015-05-07 Thread Yonik Seeley
On Thu, May 7, 2015 at 4:47 PM, Frank li wrote: > Hi Yonik, > > I am reading your blog. It is helpful. One question for you, for following > example, > > curl http://localhost:8983/solr/query -d 'q=*:*&rows=0& > json.facet={ >categories:{ > type : terms, > field : cat, > sort :

Re: JSON Facet & Analytics API in Solr 5.1

2015-05-07 Thread Frank li
om: Otis Gospodnetic [mailto:otis.gospodne...@gmail.com] > Sent: Friday, April 17, 2015 11:16 PM > To: solr-user@lucene.apache.org > Subject: Re: JSON Facet & Analytics API in Solr 5.1 > > Flatter please. The other nested stuff makes my head hurt. Until > recently I thought

RE: JSON Facet & Analytics API in Solr 5.1

2015-04-20 Thread Davis, Daniel (NIH/NLM) [C]
il 17, 2015 11:16 PM To: solr-user@lucene.apache.org Subject: Re: JSON Facet & Analytics API in Solr 5.1 Flatter please. The other nested stuff makes my head hurt. Until recently I thought I was the only person on the planet who had a hard time mentally parsing anything but the simplest

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-18 Thread Lukáš Vlček
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 inste

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-18 Thread Lukáš Vlček
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 implemen

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-18 Thread Yonik Seeley
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=

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-18 Thread Yonik Seeley
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 ou

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-17 Thread Otis Gospodnetic
I'd give a strong vote to the flatter structure. Can > someone enumerate the benefits of the current format over the flatter > structure (I'm probably dense and just failing to see them currently)? > > Thanks, > > -Trey > > > On Fri, Apr 17, 2015 at 2:28 PM,

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-17 Thread Trey Grainger
en better ;) > > > From: Yonik Seeley > Sent: Friday, April 17, 2015 12:20 PM > To: solr-user@lucene.apache.org > Subject: Re: JSON Facet & Analytics API in Solr 5.1 > > Does anyone have any thoughts on the current gener

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-17 Thread Jean-Sebastien Vachon
I prefer the second way. I find it more readable and shorter. Thanks for making Solr even better ;) From: Yonik Seeley Sent: Friday, April 17, 2015 12:20 PM To: solr-user@lucene.apache.org Subject: Re: JSON Facet & Analytics API in Solr 5.1 Does an

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-17 Thread Mike Murphy
I like the first way. It matches how elasticsearch does it http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-aggregations-bucket-range-aggregation.html Can we specify explicit ranges in Solr now like we can in elasticsearch? I do like how Solr's version of aggs can be much shorte

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-17 Thread Erick Erickson
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 wrote: > Does anyone have any thoughts on

Re: JSON Facet & Analytics API in Solr 5.1

2015-04-17 Thread Yonik Seeley
Does anyone have any thoughts on the current general structure of JSON facets? The current general form of a facet command is: : { : } For example: top_authors : { terms : { field : author, limit : 5, }} One alternative I considered in the past is having the type in the args: top_author

JSON Facet & Analytics API in Solr 5.1

2015-04-14 Thread Yonik Seeley
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