lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: Small sorting problem in spatial contrib
Date Sun, 25 Apr 2010 08:50:48 GMT
If you look into the source code of this CustomScore Spatial Test, there is mentioned that
it is broken. The problem is that the spatial contrib. sort does not work correct with multiple
segments. We are working on that, no solution here. We will have DistanceQuery in future,
that does not need sorting, as it will score with the distance in adition to normal scoring.



Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen <> 



From: Alex [] 
Sent: Sunday, April 25, 2010 4:53 AM
Subject: Small sorting problem in spatial contrib



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



View raw message