lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex <azli...@gmail.com>
Subject Small sorting problem in spatial contrib
Date Sun, 25 Apr 2010 02:52:46 GMT
Hi,

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
release.

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

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
IndexSearcher.

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
to
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.

Cheers,


Alex

Mime
View raw message