Hello,
i'm trying to use sort by distance and paging (HB4.2).
Below distance 4.4km (1115 results) everything is ok, but at distance 4.5 (and above, at 4.5 the results count = 1164), SpatialMode.GRID:
Page size = 5
row / distance / docId
0 0,168267 296390
1 0,185526 95972
2 0,233131 462088
3 0,244809 339328
4 4,456938 504155
5 0,388799 479403
6 0,393571 369602
7 0,394556 21706
8 0,426981 424484
9 4,456938 504155
.
Every page has the last row ... "4,456938 504155"
End of result:
.
1140 4,450423 468050
1141 4,450566 39684
1142 4,454901 278579
1143 4,455974 39735
1144 4,456938 504155
1145 4,456938 504155
1146 4,461120 92830
1147 4,462217 367351
1148 4,466064 209107
1149 4,466922 258184
1150 4,468246 221265
1151 4,468287 345560
1152 4,469825 72174
1153 4,481431 303744
1154 4,482714 39458
1155 4,487254 260150
1156 4,488133 434126
1157 4,490794 358606
1158 4,491543 422119
1159 4,494765 295678
1160 4,495850 171850
1161 4,496075 477950
1162 4,496294 270855
1163 4,498466 467896
At page size = 3 the same problem:
0 0,168267 296390
1 0,185526 95972
2 4,456938 504155
3 0,244809 339328
4 0,382873 328868
5 4,456938 504155
The table has 500 000 rows, random generated:
lattitue: 54.0000000989997 - 54.9999926514828, code: k.setLat(54 + random.nextDouble());
longtitude: 18.0000013922542 - 18.9999972233927, code: k.setLon(18 + random.nextDouble());
The same effect using SpatialMode.RANGE. The search code is from spatial examples (no additional filters/queries).
Java 7u11 64bit, PostgreSQL 9.1 x64, Win x64, query cache off, second level cache off.
Entity:
Code:
@Indexed
@Spatial(spatialMode = SpatialMode.GRID)
public class MyEntity implements Serializable {
@DocumentId
private Long id;
private String value;
@Latitude
private Double lat;
@Longitude
private Double lon;
private Double distance;
}
I'm doing sth wrong ?
Should I provide more information ?
Keep up good work and thanks in advance.
PB