Returning xx number of each group in a single query?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Returning xx number of each group in a single query?

Brian Lucas
Is there a way to fetch 5 records with group_id:1, 5 records with group_id:2, 5 records with group_id:3, and so forth in a single query?

The facet features don't seem to give me what I need -- same with rows.  Any ideas on how to do something like this?

Reply | Threaded
Open this post in threaded view
|

Re: Returning xx number of each group in a single query?

Chris Hostetter-3

there's nothing like that in SOlr right now, but you could write a Custom
RequestHandler to do it.

in theory you could even write a request handler thta just successivly
called another request handler by name (which could be a param) altering
the request params each time based on it's input, and consolidating all of
hte results.

: Date: Fri, 16 Mar 2007 17:59:56 -0700 (PDT)
: From: Brian Lucas <[hidden email]>
: Reply-To: [hidden email]
: To: [hidden email]
: Subject: Returning xx number of each group in a single query?
:
:
: Is there a way to fetch 5 records with group_id:1, 5 records with group_id:2,
: 5 records with group_id:3, and so forth in a single query?
:
: The facet features don't seem to give me what I need -- same with rows.  Any
: ideas on how to do something like this?
:
:
: --
: View this message in context: http://www.nabble.com/Returning-xx-number-of-each-group-in-a-single-query--tf3417627.html#a9525144
: Sent from the Solr - User mailing list archive at Nabble.com.
:



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Returning xx number of each group in a single query?

nick19701
How about returning at most 1 result of each group in a single query?

For example, a website may have a lot of pages. When google returns
search results, it only shows at most one result for each website. I have
a similar situation. Is there an easy way for this kind of problem?
Reply | Threaded
Open this post in threaded view
|

Re: Returning xx number of each group in a single query?

Ryan McKinley
In reply to this post by Brian Lucas
You may want to take a look at the related discussion:
http://www.nabble.com/result-grouping--tf2910425.html#a8131895

Yonik suggested a dynamic priority queue... if the number of things
you are grouping by is small it is probably easier to make multiple
calls to solr.

ryan


On 3/16/07, Brian Lucas <[hidden email]> wrote:

>
> Is there a way to fetch 5 records with group_id:1, 5 records with group_id:2,
> 5 records with group_id:3, and so forth in a single query?
>
> The facet features don't seem to give me what I need -- same with rows.  Any
> ideas on how to do something like this?
>
>
> --
> View this message in context: http://www.nabble.com/Returning-xx-number-of-each-group-in-a-single-query--tf3417627.html#a9525144
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Returning xx number of each group in a single query?

Brian Lucas
In reply to this post by Chris Hostetter-3
Thanks to everyone who responded thus far.  

Simple is good for right now.  Chris, is there a way to do what you describe here (write a request handler that successively calls another request handler by name) in the solrconfig.xml file, or does this require me to write a custom RequestHandler in java to perform this?

Brian
Chris Hostetter wrote
there's nothing like that in SOlr right now, but you could write a Custom
RequestHandler to do it.

in theory you could even write a request handler thta just successivly
called another request handler by name (which could be a param) altering
the request params each time based on it's input, and consolidating all of
hte results.

: Date: Fri, 16 Mar 2007 17:59:56 -0700 (PDT)
: From: Brian Lucas <blucasco@gmail.com>
: Reply-To: solr-user@lucene.apache.org
: To: solr-user@lucene.apache.org
: Subject: Returning xx number of each group in a single query?
:
:
: Is there a way to fetch 5 records with group_id:1, 5 records with group_id:2,
: 5 records with group_id:3, and so forth in a single query?
:
: The facet features don't seem to give me what I need -- same with rows.  Any
: ideas on how to do something like this?
:
:
: --
: View this message in context: http://www.nabble.com/Returning-xx-number-of-each-group-in-a-single-query--tf3417627.html#a9525144
: Sent from the Solr - User mailing list archive at Nabble.com.
:



-Hoss
Reply | Threaded
Open this post in threaded view
|

Re: Returning xx number of each group in a single query?

Chris Hostetter-3

: handler by name) in the solrconfig.xml file, or does this require me to
: write a custom RequestHandler in java to perform this?

it would be a custom java class that you could load at runtime by putting
in the "lib" directory and refering to it in your solrconfig.xml (ie: no
modifications neccessary to the war) ...

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

-Hoss