lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pdaures <>
Subject Boost Problem (again), need example !
Date Mon, 22 Feb 2010 08:54:02 GMT

I know that there are many topics about scoring issues, but I didn't find an
answer in the topics.
This is the problem :
Imagine I'm a teacher, and I have to index all the results, comments and
score about students.

Student :
String name (eg : John Smith)
String comments : (eg: John is a good student, but he needs to be more self
confident bla bla bla)
float score (eg : 98)

I have to index all the students and when I use the search class, I want to
get first the best students. So, if John Smith is a better student than John
Mickael, when I search "John" I want to have John Smith BEFORE John Mickeal.

To do that, I'm using BooleanQuery to search in name and comment fields.

First, I thought I could use the function Document.setBoost(float boost)
while indexing student, with boost = Student.score. But the result was not
what I was expected, it didn't work correctly.

Then I thought I could use a FunctionQuery to search :
FunctionQuery functionQuery = new FunctionQuery(new
But the result was still incorrect.

I don't know what I'm doing wrong. Could you help me to find a solution ?
Thank you :)
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message