lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frode Bjerkholt>
Subject Different boost values for different terms in a field.
Date Thu, 05 Oct 2006 08:10:43 GMT

My intention is to give different terms in a field different boost values.

The queries from a use perspective, will be one fulltext input field.

The following code illustrates this:

Field f1 = new Field("name", "John", Field.Store.NO, Field.Index.TOKENIZED);
Field f2 = new Field("name", "Doe", Field.Store.NO, Field.Index.TOKENIZED);



In the current version of Lucene, as far as I now, this does not work - 
Allthough it would have been a very powerful feature. 

The current solution is to make a firstname field and a lastname field, and 
then make a complex query like this:

Input: Eric Doe

(firstname:Eric OR lastname:Eric^2) AND (firstname:Doe OR lastname:Doe^2)

The performance of such a query is quite slow, and it becomes even worse when 
you have more than two fields and/or more words in the input string.

My questions:

1. Is there a better/faster solution to accomplish such a query?

2. Would it be possible to implement the described feature in a future version 
of Lucene?

Best Regards,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message