Results 1 to 1 of 1
- 02-16-2011, 02:30 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
Lucene Spatial DistanceQueryBuilder
Hi,
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[1]), new Double(point[0]), 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
Cheers RobLast edited by 3xca1ibur; 02-16-2011 at 02:31 PM. Reason: mis-post
Similar Threads
-
Lucene StringTokenizer
By JP10 in forum LuceneReplies: 0Last Post: 10-16-2010, 05:24 AM -
Apache Lucene
By dkarthiin in forum LuceneReplies: 0Last Post: 03-25-2010, 12:25 PM -
Lucene with unicode
By goms in forum LuceneReplies: 1Last Post: 02-02-2010, 01:20 PM -
how to get lucene logs
By virendra in forum LuceneReplies: 0Last Post: 01-06-2010, 10:46 AM -
Apache Lucene 2.2.0
By JavaBean in forum Java SoftwareReplies: 0Last Post: 06-22-2007, 12:47 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks