Results 1 to 1 of 1
- 02-16-2011, 02:30 PM #1Member
- Join Date
- Feb 2011
- Rep Power
Lucene Spatial DistanceQueryBuilder
I am having a few problems understanding Lucene Spatial (partially due to a lack of documentation and good examples and partially due to stupidity I am sure!)
I am trying to run a query :-
DistanceQueryBuilder builder = new DistanceQueryBuilder(new Double(point), new Double(point), 1000d,
"geohash", CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
ConstantScoreQuery queryx = new ConstantScoreQuery(builder.getFilter());
org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery(queryx,Address .class);
I am certain that there are results within 1000 miles of the provided co-ords but I have no idea how to begin debugging it.
Using Luke to look at the index I have verified that at least 2 of the geohashes convert correctly to Lat and long that are within the given region.
There is also a field on the index for _tier_9 which is the level that the search is using.
I am sure that it is something simple I am missing, any help would be great.
I also did a test as per below to check that address objects are found by this method and that worked.
QueryBuilder qb = fullTextSession.getSearchFactory()
.buildQueryBuilder().forEntity( Address.class ).get();
org.apache.lucene.search.Query qbx = qb.all().createQuery();
org.hibernate.Query fullTextQueryASD = fullTextSession.createFullTextQuery(qbx,Address.cl ass);
List resultASD = fullTextQueryASD.list(); //return a list of managed objects
Last edited by 3xca1ibur; 02-16-2011 at 02:31 PM. Reason: mis-post
- By JP10 in forum LuceneReplies: 0Last Post: 10-16-2010, 05:24 AM
- By dkarthiin in forum LuceneReplies: 0Last Post: 03-25-2010, 12:25 PM
- By goms in forum LuceneReplies: 1Last Post: 02-02-2010, 01:20 PM
- By virendra in forum LuceneReplies: 0Last Post: 01-06-2010, 10:46 AM
- By JavaBean in forum Java SoftwareReplies: 0Last Post: 06-22-2007, 12:47 AM