views:

39

answers:

1

I know I can, during search, specify a "boost factor" to a term as described in http://lucene.apache.org/java/2_4_0/queryparsersyntax.html.

My question is: Can I provide Lucene with a predefined table of relevance?

For instance, I could say that "chair" and "table" are relevant words with a boost factor of 4 and all subsequent searches would respect that.

+2  A: 

At index time you can use Payloads -- See http://www.lucidimagination.com/blog/2009/08/05/getting-started-with-payloads . Your special terms get encoded with a payload which, at query time, can be decoded and used to give an extra boost.

Alternatively, you might be able to extend the existing QueryParser to give your special terms an extra boost factor.

bajafresh4life