GWT + Lucene 空间(通过 Hibernate 搜索)

发布于 2024-10-16 18:40:42 字数 1059 浏览 14 评论 0原文

好吧,我已经重新表述了这个问题,因为我已经取得了一些进展...

嗨,

我在最后一天(很糟糕)一直在寻找一些关于如何在我的应用程序中使用 Lucene-Spatial 的帮助。

我正在使用 GWT,因此我希望客户端远离 org.apache.* 包,因为 GWT 尝试序列化客户端上的所有内容。 (使本教程不太有用:[url]http://java.dzone.com/articles/spatial-search-hibernate?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+javalobby/frontpage+(Javalobby+/+Java+ Zone)[/url])

基本上我有一个带有“纬度”字段和“经度”字段的地址对象,我想对此进行距离搜索,lucene-spatial是正确的方法还是我应该多看一些以另一种方式来做?

到目前为止,我必须:-

[code]DistanceQueryBuilder dq = new DistanceQueryBuilder(new Double(point[1]), new Double(point[0]), 10d, "activity_locationName_latitude", "activity_locationName_longitude",CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);

            FullTextSession fullTextSession = Search.getFullTextSession(session);


            org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( new ConstantScoreQuery(dq.getFilter()) );[/code]

但我不明白“CartesianTierPlotter.DEFALT_FIELD_PREFIX”的实际含义,因此我的结果集返回为空。

干杯, 抢

Ok I have re-phrased the question a bit as I have made some progress...

Hi,

I have been searching around for the last day (badly) to try to find some help on how to use Lucene-Spatial within my application.

I am using GWT so I would like to keep the client side clear of org.apache.* packages as GWT tries to serialise everything on the client side. (made this tutorial less useful : [url]http://java.dzone.com/articles/spatial-search-hibernate?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+javalobby/frontpage+(Javalobby+/+Java+Zone)[/url])

Basically I have an address object with a field "latitude" and a field "longitude" and I would like to do distance searches against this, is lucene-spatial the right way to go or should I look more into doing it in another way?

So far I have got to :-

[code]DistanceQueryBuilder dq = new DistanceQueryBuilder(new Double(point[1]), new Double(point[0]), 10d,
"activity_locationName_latitude", "activity_locationName_longitude",CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);

            FullTextSession fullTextSession = Search.getFullTextSession(session);


            org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( new ConstantScoreQuery(dq.getFilter()) );[/code]

But I dont understand what "CartesianTierPlotter.DEFALT_FIELD_PREFIX" is meant to actually be, and as such my result set comes back empty.

Cheers,
Rob

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风和你 2024-10-23 18:40:42

我目前正在开发一个使用 Lucene / Hibernate 搜索但不使用 Lucene 空间的 GWT 应用程序。

您遇到的问题是否与 Lucene 空间的使用有关?如果没有,那么我可以提供帮助,因为我在 GWT 应用程序中设置了所有 Lucene / Hibernate 搜索内容,并且它的工作方式就像一个魅力(换句话说,我在基于 GWT 的应用程序中使用 org.apache.lucene 中的类)。

I am currently working on a GWT app that uses Lucene / Hibernate Search but not Lucene spatial.

Is the issue you having very specific to the use of Lucene spatial? If not, then I could assist since I set all the Lucene / Hibernate Search stuff in our GWT app and it works like a charm (in other words I am using classes from org.apache.lucene with in a GWT-based app).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文