Spatial search with sort by distance and paging orders entities incorrectly and repeats them

Description

Spatial search with sort by distance and paging orders entities incorrectly and repeats them.

Same problem using SpatialMode.RANGE and GRID.

Example output from unit test (page size = 5):

index / distance / entity id:
0 1,854654 46
1 2,476669 11
2 3,628696 14
3 3,986162 1
4 9,840840 48 wrong order

5 6,909802 44
6 8,288416 13
7 8,673849 9
8 8,891801 6
9 9,840840 48 was at index 4, wrong order

10 13,790553 17
11 14,801496 5
12 14,959930 2
13 15,407163 21
14 16,545712 10

15 14,801496 5 was at index 11
16 14,959930 2 was at index 12
17 15,407163 21 was at index 13
18 16,545712 10 was at index 14
19 16,622222 18

20 14,972440 39
21 15,407163 21 was at index 13
22 16,028147 31
23 16,545712 10 was at index 14
24 16,622222 18 was at index 19

25 16,622222 18 was at index 19
26 16,652192 20
27 17,444358 33
28 18,885611 7
29 19,359880 35

30 16,652192 20 was at index 26
31 17,444358 33 was at index 27
32 18,885611 7 was at index 28
33 19,359880 35 was at index 29
34 19,391599 26

35 19,559055 22
36 19,968307 45

Attachments

1

Activity

Show:

Sanne Grinovero February 13, 2013 at 1:47 PM

Hi Piotr,
thanks I had received your CLA so integrated it. Strange I only received notification from JIRA today: sorry for the late reply!

Piotr B. February 6, 2013 at 9:45 AM
Edited

@Nicolas: Of course.
@Sannes: I've signed CLA. It's OK ?

Please modify the unit test if it helps - I'm not experienced in unit test best practices.

Sanne Grinovero February 5, 2013 at 7:24 PM
Edited

Hi Piotr,
Nicolas solved the problem but we need you to sign the contributor agreement to include your unit test in our testsuite.
Could you please sign this for the Hibernate project? https://cla.jboss.org

Nicolas Helleringer February 4, 2013 at 3:49 PM

Piotr ? May I integrate your code of the test case in the test suite of hibernate search please ?

Nicolas Helleringer January 31, 2013 at 6:00 PM

Ok found.

Thanks a LOT for the perfect test case.

Patch/Fix incoming.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created January 30, 2013 at 1:06 AM
Updated May 8, 2013 at 9:04 AM
Resolved February 7, 2013 at 1:39 PM