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 Walt Stoneburner <wa...@gmail.com> on 2007/03/14 20:18:39 UTC

Search vs. Rank

Most search engine technologies return result sets based some weighted
frequency of the search terms found.  I've got a new problem, I want to rank
by different criteria than I searched for.

For example, I might want to return as my result set all documents that
contain the word pizza, but rank them according to topping preferences (with
garlic at the top and goat cheese at the bottom).

Two questions.

1) Does Lucene allow one to mandatorily search for a term, but provide it
zero weight, while allowing other terms to have zero influence on the result
set, but affect their order?

I'm thinking something like  +pizza^0 garlic^1 "goat cheese"^-1

The concern is that I don't want any results that happen to mention garlic
or goat cheese except in the context of pizza.

2) Once I have this list of results, can I change their rank order without
having to do a full scale search again?

-wls

Re: Search vs. Rank

Posted by Chris Hostetter <ho...@fucit.org>.
: I'm thinking something like  +pizza^0 garlic^1 "goat cheese"^-1

that does in fact work.

: 2) Once I have this list of results, can I change their rank order without
: having to do a full scale search again?

the frequency of "pizza' won't affect the score at all, so you should need
to do much to change the order ... but you can implement your own custom
Sort to get any order you want.

An alternate appraoch is to use a Filter to define the super set of all
things you are interested in (ie: "pizza") and then execute a Query
against that Filter that matches all docs, scoring the ones you care the
most about higher.


-Hoss


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