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 Oliver Donald <ol...@SnowValley.com> on 2006/10/27 11:09:29 UTC

Scoring documents by position

Hi,

I'm quite new to Lucene but I've managed to get it to return quite
complex results. The problem is that the results aren't bringing up the
most relevant documents first.

Is it possible to score or boost a result document based on where a
search term appears in a field? Ie, if I search in a title field for
'OpenGL', is it possible to have results like 'OpenGL Guide' to be
scored highter then 'A Guide to OpenGL' ?

Any help appreciated!
Thanks,
Oli


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


Re: Scoring documents by position

Posted by Chris Hostetter <ho...@fucit.org>.
: > 'OpenGL', is it possible to have results like 'OpenGL Guide' to be
: > scored highter then 'A Guide to OpenGL' ?
:
: SpanFirstQuery does this, but afaik there is no query parser supporting it.

if howeveryou *allways* want queries to work this way, it would be pretty
straight foward to subclass QueryParser so that it's current uses of
TermQuery are replaces with SpanFirstQuery.



-Hoss


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


Re: Scoring documents by position

Posted by Paul Elschot <pa...@xs4all.nl>.
On Friday 27 October 2006 11:09, Oliver Donald wrote:
> Hi,
> 
> I'm quite new to Lucene but I've managed to get it to return quite
> complex results. The problem is that the results aren't bringing up the
> most relevant documents first.
> 
> Is it possible to score or boost a result document based on where a
> search term appears in a field? Ie, if I search in a title field for
> 'OpenGL', is it possible to have results like 'OpenGL Guide' to be
> scored highter then 'A Guide to OpenGL' ?

SpanFirstQuery does this, but afaik there is no query parser supporting it.

Regards,
Paul Elschot

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