List Info

Thread: Grouping by field value




Grouping by field value
country flaguser name
United States
2007-10-08 11:59:37
Hello Gurus,
                
I just started working on a lucene based project and I need
your help on the following queries.
The result of search needs to show a summary based on a
Field value.
One of the field in the search Document is "type"
with some possible values like "good" ,
"bad", "better" etc...
Now the summary of result should contain like good(8),
bad(4), better(16) etc...
One possible way to find is to traverse through the Hits and
count individual hit for "type" field type. I
think this would be expensive, and let me know what do you
think. Is there any other way to know count based on a field
value.

My next question is very simple, I just wanted to search
more than one field something like search for "kbk
pencil" in "description" field and
"manufacturer" field. Can I use BooleanQuery for
that?

I would appreciate your help on this.

- RB


     
____________________________________________________________
________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch
previews, get listings, and more!
http://tv.yahoo.
com/collections/3658 
Re: Grouping by field value
user name
2007-10-08 12:12:44
On 10/8/07, Cool Coder <techcool.krishnayahoo.com> wrote:
> I just started working on a lucene based project and I
need your help on the following queries.
> The result of search needs to show a summary based on a
Field value.
> One of the field in the search Document is
"type" with some possible values like
"good" , "bad", "better"
etc...
> Now the summary of result should contain like good(8),
bad(4), better(16) etc...

If Solr will work for you, it has faceting built in.

q=foo&facet=on&facet.field=type

If not, and the number of unique values in the field is low,
set
intersections can be much faster than counting hits (for a
large
number of hits).

> My next question is very simple, I just wanted to
search more than one field something like search for
"kbk pencil" in "description" field and
"manufacturer" field. Can I use BooleanQuery for
that?

It depends highly on what you want to match... is kbk in one
field and
pencil in the other field acceptable or not, etc?

Again, if you can use Solr, check out the dismax handler...
it
constructs multi-field queries for you with different
weights on the
fields.

-Yonik

------------------------------------------------------------
---------
To unsubscribe, e-mail: java-user-unsubscribelucene.apache.org
For additional commands, e-mail: java-user-helplucene.apache.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )