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 Thomas Thomas <de...@gmail.com> on 2007/05/06 23:03:46 UTC

Scoring question - Get Score of Best Query in BooleanQuery

Hello everyone,

Whenever I search a word in my web application, I search in some default
fields,
e.g. I search the word "hello", I generate these queries :

title:hello
headlines:hello
summary:hello
content:hello

Which I add in a BooleanQuery  (BooleanClause.Occur.SHOULD)

What I want to achieve is getting the score of the query that matches the
word entered, and return that score.
(e.g. hello was found in the summary, return the score of summary:hello,
and not the score of "title:hello headlines:hello summary:hello
content:hello")
(it should first look into my title field , then headlines , then summary,
etc.)

The problem is that my score is pretty low (and getting lower if I add more
fields in which to search)
and I tought that it is more obvious to return the best score of the best
query in my BooleanQuery.

I hope I was clear and that anyone here can help me in achieving this,
Thank u for any support.