lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From melix <>
Subject Span queries and complex scoring
Date Tue, 11 Sep 2007 14:17:10 GMT


I'm working on an application which requires a complex scoring (based on
semantics analysis). The scoring must be highly configurable, and I've found
ways to do that, but I'm facing a discrete but annoying problem. All my
queries are, basically, complex span queries. I mean for example a
SpanNearQuery which embeds a SpanOrQuery which itself may embed another
SpanNearQuery etc...

I've followed the instructions at
about changing scoring. The problem is that a document score is highly
dependent on *what* matched, and that the getSpans() method on spanqueries
does not provide that kind of information.

I created my own SpanQuery subclasses which override the createWeight method
so that the scorer used is my own too. It basically replaces the SpanScorer,
and should recurse the spans tree to compose a score based on the type of
subqueries (near, and, or, not) and what matched. The problem is that the
getspans() methods that exists in Lucene are either anonymous classes which
I cannot browse, or that I have not access to the required information.

Basically, in a SpanOrQuery, I am not able to find out what matched. Have
any of you faced that kind of problem, and found out an elegant way to do it
without having to completely rewrite each getSpans() method for all types of
queries (this is basically what was done in a previous version of the
application) ?



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