Grokbase Groups Lucene dev April 2010

I've been playing around with the SpatialFilter that Chris Male and others
ares developing.
I must say it seems to work fine and I'm really eager to see the final

However I think I found a small bug that occurs at scoring time in some

The SpatialFilter does its job pretty well but when

TestSpatialFilter.DistanceCustomScoreQuery.customScore(int doc, float
subQueryScore, float valSrcScore) {
Double docDistance = spatialFilter.getDistanceFilter().getDistance(doc);

is called I get

docDistance = null

which prevents the scoring to occur correctly.

I've been reading the code a litle to see what occurs under the hood and it
seems to me the problem is linked with the ThreadedDistanceFilter and

The problem really occurs when IndexSearcher's public void search(Weight
weight, Filter filter, Collector collector) is called and when it has more
than 1 subReader

near line 260 of IndexSearcher

for (int i = 0; i < subReaders.length; i++) { // search each subreader
collector.setNextReader(subReaders[i], docStarts[i]);
searchWithFilter(subReaders[i], weight, filter, collector);

What seems to happen is that ThreadedDistanceFilter stores the correct
document id in it's inner distances Map but somehow the value that is passed
TestSpatialFilter.DistanceCustomScoreQuery.customScore(int doc, float
subQueryScore, float valSrcScore)
is not correct and probably corresponds to the bit position of the subReader

I hope I'm clear enough ...

I have no idea on how to fix this. I hope this helps you guys and you can
find a workaround.
Let me know what I can do to fix this problem.

Thanks for helping.



Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
groupdev @
postedApr 25, '10 at 2:53a
activeApr 26, '10 at 12:06a

2 users in discussion

Alex: 2 posts Uwe Schindler: 2 posts



site design / logo © 2021 Grokbase