You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by mitu2009 <mu...@gmail.com> on 2009/10/01 02:40:17 UTC

Help needed ordering search results

Hi,

I've 3 records in Lucene index.

Record 1 contains healthcare in title field. Record 2 contains healthcare
and insurance in description field but not together. Record 3 contains
healthcare insurance in company name field.

When a user searches for healthcare insurance,I want to show records in the
following order in search results...

a.Record #3---because it contains both the words of the input together(ie.as
a phrase) b.Record #1 c.Record #2

How do i achieve this in lucene?

Thanks.

-- 
View this message in context: http://www.nabble.com/Help-needed-ordering-search-results-tp25691552p25691552.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Help needed ordering search results

Posted by Karl Wettin <ka...@gmail.com>.
Not quite sure what you ask for, but I think you want to use a span  
near query (for adding boost to phrases) in a disjunction max query  
(to define weights of the different fields).


     karl

1 okt 2009 kl. 02.40 skrev mitu2009:

>
> Hi,
>
> I've 3 records in Lucene index.
>
> Record 1 contains healthcare in title field. Record 2 contains  
> healthcare
> and insurance in description field but not together. Record 3 contains
> healthcare insurance in company name field.
>
> When a user searches for healthcare insurance,I want to show records  
> in the
> following order in search results...
>
> a.Record #3---because it contains both the words of the input  
> together(ie.as
> a phrase) b.Record #1 c.Record #2
>
> How do i achieve this in lucene?
>
> Thanks.
>
> -- 
> View this message in context: http://www.nabble.com/Help-needed-ordering-search-results-tp25691552p25691552.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org