lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Maxwell" <k...@casttv.com>
Subject Re: Field rank?
Date Wed, 10 Oct 2007 09:04:09 GMT
> I have a question that I can't quite seem to find the answer to by
> googling or searching the archives of this mailing list. The problem
> is I would like to weight some fields more than others. Assume that I
> have three fields: title, author, and default where title and author
> contain there respective attributes and default contains all text
> extracted from the document. When a user searches for 'foo' i would to
> see at the top of the result list documents that contain 'foo' in the
> title.
>
> Looking through the archive I see i could re-craft my user's query as such:
>
> (title: foo)^3 OR (author: foo)^2 OR (default: foo)
>
> But this doesn't seem very elegant of a solution to the problem and
> becomes more problematic as the number of fields increase. Also I'm
> not sure if this is possible if the user entered more complex
> queries...

One of the MultiFieldQueryParser's constructors has a field boost argument.

-- 
Kyle Maxwell
Software Engineer
CastTV, Inc
http://www.casttv.com

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


Mime
View raw message