lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Sort by relevance+distance
Date Sat, 17 Sep 2005 22:46:50 GMT

On Sep 17, 2005, at 4:10 PM, James Huang wrote:

> Hi,
>
> I can sort the search results by distance now. But,
> the relevance is lost.
>
> I like to have the results sorted by relevance +
> distance, i.e., relevance first; for results of
> similar relevance, order by distance. How to do that?

How are you currently sorting?   You can use multiple sort fields  
within a Sort.

     Erik




>
> Thanks a lot in advance!
> -James
>
>
> --- James Huang <metaprgmr@yahoo.com> wrote:
>
>
>> Hi Otis,
>>
>> Thanks for your answer. I do have LIA (but not with
>> me
>> now physically), and have the impression that the
>> search ordering is predetermined (at index time);
>> what
>> I want is search-time ordering, e.g.,
>>
>> "I'm at (x,y) now and low on gas; find me the
>> closest
>> airports that can land 747, the closest first,
>> please".
>>
>> I'll re-read the book/chapter tonight, but look
>> forward to any expert advises.
>>
>> Thanks,
>> -James
>>
>> --- Otis Gospodnetic <otis_gospodnetic@yahoo.com>
>> wrote:
>>
>>
>>> Hi James,
>>>
>>> Check out the org.apache.lucene.search.package,
>>> there are several sort
>>> classes that will let you write  a custom sorter.
>>> If you have a copy
>>> of LIA, look at chapter 6 for an example (
>>>
>>>
>>
>>
> http://www.lucenebook.com/search?query=custom+sort+section%3A6*
>
>>> )
>>>
>>> Otis
>>>
>>> --- James Huang <metaprgmr@yahoo.com> wrote:
>>>
>>>
>>>> Suppose I have a book index with
>>>>
>>> field="publisher", field="title",
>>>
>>>> etc.
>>>> If a user has bought Manning books, then I like
>>>>
>> to
>>
>>> sort the result
>>>
>>>> with Manning books listed first.
>>>>
>>>> In essence, I'm asking for a parameterized
>>>>
>> custom
>>
>>> sorting. Is there a
>>>
>>>> way to do this?
>>>>
>>>> Thanks,
>>>> -James
>>>>
>>>>
>>>>
>>>> ---------------------------------
>>>> Yahoo! for Good
>>>>  Click here to donate to the Hurricane Katrina
>>>>
>>> relief effort.
>>>
>>>
>>>
>>>
>>
>>
> ---------------------------------------------------------------------
>
>>> To unsubscribe, e-mail:
>>> java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail:
>>> java-user-help@lucene.apache.org
>>>
>>>
>>>
>>
>>
>>
>>
>> __________________________________
>> Yahoo! Mail - PC Magazine Editors' Choice 2005
>> http://mail.yahoo.com
>>
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.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


Mime
View raw message