Re: Amount range and facet fields returns [facet_fields]

2009-01-08 Thread Yevgeniy Belman
Ah ok,

the response i get when executing only the following, produces no facet
counts. It could be a bug.

facet.query=[price:[* TO 500], price:[500 TO *]



However, when i add an unrelated facet field, i do get the desired count:

query=[price:[* TO 500], price:[500 TO *]],q=*:*,facet.field=cat

output:

price:[* TO 500]:2

price:[500 TO *]:3



Looking at StatsComponent i can't see a way to produce this result:

for given price set (150.99,199.99,699.99,930.0,2300.0),

output:

price:[150.99 TO 199.99]:2

price:[699.99 TO 930.0]:2

price:[930.0 TO 2300.0]:1



That is if I wanted to produce up-to three price ranges. Example:

http://www.tigerdirect.com/applications/category/category_slc.asp?CatId=2775name=22-LCD-Monitor;



Thanks,

Yev.


On Thu, Jan 8, 2009 at 12:21 AM, Shalin Shekhar Mangar 
shalinman...@gmail.com wrote:

 On Thu, Jan 8, 2009 at 9:49 AM, Yevgeniy Belman ysbel...@gmail.com
 wrote:

  Hi,
 
  I am curious if this is expected behavior in a typical facet with range
  query:
  params={facet=true,facet.query=[price:[* TO 500], price:[500 TO
  *]],q=*:*,facet.field=price
 
  i am getting back not only the:
  facet_queries={price:[* TO 500]=2,price:[500 TO *]=3}
 
  but also:
  facet_fields={price={150.99=1,199.99=1,699.99=1,930.0=1,2300.0=1}


 You are adding both facet.query=price[... and the facet.field=price
 parameters so the response contains results for both.

 I was searching for a way to create the elusive dynamic amount ranges,
 and
  this would allow me to do it on the client side for sure, but is this
  right?
  Solr will send all of this data back? It consists of every price variant
  with a count. In my case 5 prices were all unique. If real data were used
  could this be too big to send across?
 
  SimpleFacet.getFacetCounts() populates the response object with it. Is
 this
  an appropriate place to calculate my dymic amount ranges and replace
  facet_fields:
  res.add(facet_queries, getFacetQueryCounts());
  res.add(facet_fields, getFacetFieldCounts()); // -- replace with
  Dynamic facets
  res.add(facet_dates, getFacetDateCounts());
 
  or should it be done sooner, somewhere in getFieldCacheCounts() where the
  itteration through all the 5 docs is happening?
 

 By dynamic ranges, do you mean that you want min and max values? If yes,
 you
 can look at StatsComponent (it is a 1.4 feature, so you'll need to use the
 nightly builds).

 http://wiki.apache.org/solr/StatsComponent

 --
 Regards,
 Shalin Shekhar Mangar.



Amount range and facet fields returns [facet_fields]

2009-01-07 Thread Yevgeniy Belman
Hi,

I am curious if this is expected behavior in a typical facet with range
query:
params={facet=true,facet.query=[price:[* TO 500], price:[500 TO
*]],q=*:*,facet.field=price

i am getting back not only the:
facet_queries={price:[* TO 500]=2,price:[500 TO *]=3}

but also:
facet_fields={price={150.99=1,199.99=1,699.99=1,930.0=1,2300.0=1}

I was searching for a way to create the elusive dynamic amount ranges, and
this would allow me to do it on the client side for sure, but is this right?
Solr will send all of this data back? It consists of every price variant
with a count. In my case 5 prices were all unique. If real data were used
could this be too big to send across?

SimpleFacet.getFacetCounts() populates the response object with it. Is this
an appropriate place to calculate my dymic amount ranges and replace
facet_fields:
res.add(facet_queries, getFacetQueryCounts());
res.add(facet_fields, getFacetFieldCounts()); // -- replace with
Dynamic facets
res.add(facet_dates, getFacetDateCounts());

or should it be done sooner, somewhere in getFieldCacheCounts() where the
itteration through all the 5 docs is happening?

Thanks,
Yev


RE: Solr FAQ entry about Dynamically calculated range facet topic

2009-01-06 Thread Yevgeniy Belman
So did anyone put together a FAQ on this subject? I am also interested in
seeing the different ways to get dynamic faceting to work.

In this post, Chris Hostetter dropped a piece of handler code. Is it still
the right path to take for those generated ranges:
$0..$20 (3)
$20..$75 (15)
$75..$123 (8)

Re: Dynamically calculated range facet
http://www.mail-archive.com/solr-user@lucene.apache.org/msg04727.html


Solrj, drill down, facets.

2009-01-05 Thread Yevgeniy Belman
I am playing with solrj trying to run through a few scenarios one of which
is to drill down into a facet. Here, my facet is manu. I want to narrow
the search by requesting anything that matches ipod, and falls into an
apple manufacturer facet. I am new to Solr/Lucene, my appologies for basic
question.

Thru trial and error i got this line to narrow the facet:
query.add(fq, manu:apple);

but what does this line do? I didn't notice any result difference.
query.addFacetQuery(manu:apple);