You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by muddassir hasan <mu...@yahoo.co.in> on 2008/01/18 09:55:03 UTC

Getting multiple category results

Dear friends,

I have started using Solr recently. I am facing a problem that in a query to solr i can get results sorted either on my date filed or on score which is calculated through frequency and proximity of query keywords in indexed documents. Is there a way to get score which combines both i.e. if document is too relevant for the query then it should appear first and later documents which have a score lesser than a threshold are sorted on date.

Moreover, I wanted to know is there a way to get multiple category results in one query i.e. i have a field named category in the document being indexed and for a query I want 2 most relevant results from each of the category for first 10 results and similarly for further results.


Please give your suggestions.

Bye,
M. Hasan


Muddassir Hasan


       
---------------------------------
 Save all your chat conversations. Find them online.

Re: Getting multiple category results

Posted by Yonik Seeley <yo...@apache.org>.
On Jan 18, 2008 11:54 PM, muddassir hasan <mu...@yahoo.co.in> wrote:
> Thanks Ryan,
>
> Field collapsing that u have suggested is close to what i want.
>
> But I am still in need of certain solution to my first problem i.e. sorting on combined score of date and relevancy of document.

See the DisMax handler, esp the bf parameter (boost function) where
you can add the score of a function query into the full-text relevancy
score.

 An incomplete answer is here:
http://wiki.apache.org/solr/SolrRelevancyFAQ

-Yonik

Re: Getting multiple category results

Posted by muddassir hasan <mu...@yahoo.co.in>.
Thanks Ryan,

Field collapsing that u have suggested is close to what i want.

But I am still in need of certain solution to my first problem i.e. sorting on combined score of date and relevancy of document.

Dear friends, please put in your suggestions.

M.Hasan

Ryan McKinley <ry...@gmail.com> wrote: muddassir hasan wrote:
> Dear friends,
> 
> I have started using Solr recently. I am facing a problem that in a query to solr i can get results sorted either on my date filed or on score which is calculated through frequency and proximity of query keywords in indexed documents. Is there a way to get score which combines both i.e. if document is too relevant for the query then it should appear first and later documents which have a score lesser than a threshold are sorted on date.
> 

I'm not sure... someone else can answer better.  I think lucene 2.3 has 
something that makes this easier, but I don't know.


> Moreover, I wanted to know is there a way to get multiple category results in one query i.e. i have a field named category in the document being indexed and for a query I want 2 most relevant results from each of the category for first 10 results and similarly for further results.
> 

I don't quite follow, do you just need an or query
   fq=category:(cat1 OR cat2)
that would limit your results to things that had either category.

Or are you referring to field collapsing?
https://issues.apache.org/jira/browse/SOLR-236

ryan




Muddassir Hasan


       
---------------------------------
 Chat on a cool, new interface. No download required. Click here.

Re: Getting multiple category results

Posted by Ryan McKinley <ry...@gmail.com>.
muddassir hasan wrote:
> Dear friends,
> 
> I have started using Solr recently. I am facing a problem that in a query to solr i can get results sorted either on my date filed or on score which is calculated through frequency and proximity of query keywords in indexed documents. Is there a way to get score which combines both i.e. if document is too relevant for the query then it should appear first and later documents which have a score lesser than a threshold are sorted on date.
> 

I'm not sure... someone else can answer better.  I think lucene 2.3 has 
something that makes this easier, but I don't know.


> Moreover, I wanted to know is there a way to get multiple category results in one query i.e. i have a field named category in the document being indexed and for a query I want 2 most relevant results from each of the category for first 10 results and similarly for further results.
> 

I don't quite follow, do you just need an or query
   fq=category:(cat1 OR cat2)
that would limit your results to things that had either category.

Or are you referring to field collapsing?
https://issues.apache.org/jira/browse/SOLR-236

ryan