Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: General

Lucene-Spatial and Hibernate Search

 

 

Lucene general RSS feed   Index | Next | Previous | View Threaded


alan.sunley at gmail

May 3, 2011, 9:49 PM

Post #1 of 6 (400 views)
Permalink
Lucene-Spatial and Hibernate Search

Hi all,

First of all, I have to say my understanding of Lucene Spatial is very
little and the Googling and forum/mail list searching hasn't gotten me very
far.

I'm trying to determine if I can use Lucene-Spatial 3.1.0 with Hibernate
Search 3.1.0. The article on DZone talks of this very issue:
http://java.dzone.com/articles/spatial-search-hibernate

I'm having trouble with the implementation though, I have tried implementing
the getLatLng() ( with CartesianTierFieldBridgeImpl ) and getGeohash()
methods in the Entity, without success.

Does anyone have experience mixing the two who could provide some pointers?

I'm working with the following code below to attempt the return the
addresses that are within 5 miles of NY:

DistanceQueryBuilder builder = new
DistanceQueryBuilder(40.689168,-74.044563, 10.0, "addrLatitude",
"addrLongitude", CartesianTierPlotter.DEFALT_FIELD_PREFIX, true, 0, 20);

FullTextSession fullTextSession = Search.getFullTextSession(
sessionFactory.getCurrentSession() );

FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(
builder.getQuery( new MatchAllDocsQuery() ), Address.class );

fullTextQuery.list();

--
View this message in context: http://lucene.472066.n3.nabble.com/Lucene-Spatial-and-Hibernate-Search-tp2897389p2897389.html
Sent from the Lucene - General mailing list archive at Nabble.com.


dsmiley at mitre

May 4, 2011, 7:45 AM

Post #2 of 6 (392 views)
Permalink
Re: Lucene-Spatial and Hibernate Search [In reply to]

Film,
The Lucene spatial module is slated to be eliminated soon because of its complexity and bugs that have confounded Lucene committers. Ryan McKinley, Chris Male, and I are working on a replacement but it isn't ready. If I were you I wouldn't waste time trying to understand that module. If you can wait a couple months, I would wait. If not, I suggest looking at the basic geospatial search capability in Solr (which uses very little from Lucene) and then try to extract that. I'll warn you if you need to do any distance sorting, it's going to get complicated fast. Distance sorting uses Solr function queries.

~ David Smiley
Author: http://www.packtpub.com/solr-1-4-enterprise-search-server/

On May 4, 2011, at 12:49 AM, Film Noir wrote:

> Hi all,
>
> First of all, I have to say my understanding of Lucene Spatial is very
> little and the Googling and forum/mail list searching hasn't gotten me very
> far.
>
> I'm trying to determine if I can use Lucene-Spatial 3.1.0 with Hibernate
> Search 3.1.0. The article on DZone talks of this very issue:
> http://java.dzone.com/articles/spatial-search-hibernate
>
> I'm having trouble with the implementation though, I have tried implementing
> the getLatLng() ( with CartesianTierFieldBridgeImpl ) and getGeohash()
> methods in the Entity, without success.
>
> Does anyone have experience mixing the two who could provide some pointers?
>
> I'm working with the following code below to attempt the return the
> addresses that are within 5 miles of NY:
>
> DistanceQueryBuilder builder = new
> DistanceQueryBuilder(40.689168,-74.044563, 10.0, "addrLatitude",
> "addrLongitude", CartesianTierPlotter.DEFALT_FIELD_PREFIX, true, 0, 20);
>
> FullTextSession fullTextSession = Search.getFullTextSession(
> sessionFactory.getCurrentSession() );
>
> FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(
> builder.getQuery( new MatchAllDocsQuery() ), Address.class );
>
> fullTextQuery.list();
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Lucene-Spatial-and-Hibernate-Search-tp2897389p2897389.html
> Sent from the Lucene - General mailing list archive at Nabble.com.


alan.sunley at gmail

May 5, 2011, 8:10 PM

Post #3 of 6 (378 views)
Permalink
Re: Lucene-Spatial and Hibernate Search [In reply to]

Hi David,

Thanks for your reply. I wish I had the expertise and time to explore the
Solr option! As it is more of a personal project of mine, I think I can
wait.

By the way, is this the new replacement you mentioned?

http://code.google.com/p/lucene-spatial-playground/

Basically I would like a user to be able to conduct a text based search with
additional locational conditions. In particular I would like to be able to
pull records from an index where the coordinates are within x distance of
user supplied coordinates, and also within a polygon. Is this functionality
possible in the proposed replacement module?

Either way, I look forward in seeing how the replacement module develops.

Regards,

--
View this message in context: http://lucene.472066.n3.nabble.com/Lucene-Spatial-and-Hibernate-Search-tp2897389p2906731.html
Sent from the Lucene - General mailing list archive at Nabble.com.


ted.dunning at gmail

May 5, 2011, 10:30 PM

Post #4 of 6 (373 views)
Permalink
Re: Lucene-Spatial and Hibernate Search [In reply to]

I think you are misunderestimating the difficulty of getting started with
Solr.

Try it for an hour. You might like it. From your questions it really
sounds like your goals are a bit more on the Solr level of the stack than
the Lucene level of the stack.

On Thu, May 5, 2011 at 8:10 PM, Film Noir <alan.sunley [at] gmail> wrote:

> Thanks for your reply. I wish I had the expertise and time to explore the
> Solr option! As it is more of a personal project of mine, I think I can
> wait.
>


dsmiley at mitre

May 6, 2011, 6:14 AM

Post #5 of 6 (385 views)
Permalink
Re: Lucene-Spatial and Hibernate Search [In reply to]

On May 5, 2011, at 11:10 PM, Film Noir wrote:

>
> By the way, is this the new replacement you mentioned?
>
> http://code.google.com/p/lucene-spatial-playground/

Yes.

And I very much agree with Ted's sentiment; if you are not wedded to Hibernate-Search, then be all means try out Solr directly! A major design goal / feature of Solr is overall accessibility to search technology. It makes search and various advanced features easy to use.

~ David


hongsgo at gmail

May 9, 2011, 6:03 AM

Post #6 of 6 (391 views)
Permalink
Re: Lucene-Spatial and Hibernate Search [In reply to]

I'm sorry to inquiries in the first place,
I have to development Web services in the following specifications.
i want to know the performance issues. the Location-based search solution
system

1. mongodb geopartial index
2. geohash + lucene( + hibernate search)

what is the good choice?
somebody help me.

if you have any idea.
please contact for me.

hongsgo [at] gmail

1.mongodb geopartial index
http://www.mongodb.org/display/DOCS/Geospatial+Indexing

2. geohash + lucene (+ hibernate search)
geohash? : Http://en.wikipedia.org/wiki/Geohash<http://en.wikipedia.org/wiki/Geohash>

Thanks for reading

2011/5/4 Film Noir <alan.sunley [at] gmail>

> Hi all,
>
> First of all, I have to say my understanding of Lucene Spatial is very
> little and the Googling and forum/mail list searching hasn't gotten me very
> far.
>
> I'm trying to determine if I can use Lucene-Spatial 3.1.0 with Hibernate
> Search 3.1.0. The article on DZone talks of this very issue:
> http://java.dzone.com/articles/spatial-search-hibernate
>
> I'm having trouble with the implementation though, I have tried
> implementing
> the getLatLng() ( with CartesianTierFieldBridgeImpl ) and getGeohash()
> methods in the Entity, without success.
>
> Does anyone have experience mixing the two who could provide some pointers?
>
> I'm working with the following code below to attempt the return the
> addresses that are within 5 miles of NY:
>
> DistanceQueryBuilder builder = new
> DistanceQueryBuilder(40.689168,-74.044563, 10.0, "addrLatitude",
> "addrLongitude", CartesianTierPlotter.DEFALT_FIELD_PREFIX, true, 0, 20);
>
> FullTextSession fullTextSession = Search.getFullTextSession(
> sessionFactory.getCurrentSession() );
>
> FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(
> builder.getQuery( new MatchAllDocsQuery() ), Address.class );
>
> fullTextQuery.list();
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Lucene-Spatial-and-Hibernate-Search-tp2897389p2897389.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>



--

Lucene general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.