-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Geo-location search with sort and paging.
PostPosted: Sun Jan 27, 2013 6:33 pm 
Newbie

Joined: Sat Jan 26, 2013 8:14 pm
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: Geo-location search with sort and paging.
PostPosted: Mon Jan 28, 2013 4:54 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi PB,
thanks that definitely looks like a bug. Could you please report it on JIRA ?

https://hibernate.onjira.com/browse/HSEARCH

If you could write a unit test that would be very kind.

Thanks for reporting this!

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Geo-location search with sort and paging.
PostPosted: Tue Jan 29, 2013 7:13 pm 
Newbie

Joined: Sat Jan 26, 2013 8:14 pm
Posts: 2
sanne.grinovero wrote:
Could you please report it on JIRA ?


Reported: https://hibernate.onjira.com/browse/HSEARCH-1267

sanne.grinovero wrote:
If you could write a unit test that would be very kind.


Provided.

PB


Top
 Profile  
 
 Post subject: Re: Geo-location search with sort and paging.
PostPosted: Thu Jan 31, 2013 9:29 am 
Contributor
Contributor

Joined: Tue Jan 29, 2013 11:56 am
Posts: 3
I shall have a look at it ASAP.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.