SOLR (3.1+) - 在同一请求中使用 OR 进行多个空间查询

发布于 2024-12-08 06:07:43 字数 395 浏览 1 评论 0原文

是否可以在同一个 SOLR (3.1+) 请求中进行多个空间查询?

目前,我们需要允许用户通过前端搜索表单搜索其选择的位置的库存。但我们还想在幕后添加另一个空间搜索,以便包含更多库存。结果搜索将产生维恩图类型的搜索。

编辑 2011 年 4 月 10 日

构造示例: q=*:*&fq={!geofilt}&sfield=位置&(ClientId:"client1"&pt=40.68063802521456,-74.003 90625&d=80.4672)%20OR%20_query_:(ClientId:"client2"&pt=36.1146460,-115.1728160&d=80.4672)

上面的构造不起作用,但希望能展示我想要实现的目标。

Is it possible to conduct multiple spatial queries within the same SOLR (3.1+) request?

We currently have a need to allow user to search for inventory with a location of their choice via a frontend search form. But we want to also add another spatial search behind the scenes so it will include more inventory. The resulting search would result in a venn diagram type of search.

Edit 10.4.2011

Example construct: q=*:*&fq={!geofilt}&sfield=Location&(ClientId:"client1"&pt=40.68063802521456,-74.00390625&d=80.4672)%20OR%20_query_:(ClientId:"client2"&pt=36.1146460,-115.1728160&d=80.4672)

The above construct does not work, but hopefully demonstrates what I am trying to accomplish.

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

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

发布评论

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

评论(3

多像笑话 2024-12-15 06:07:43

这已经很旧了,但似乎还没有得到完整的答案。我遇到了同样的问题,发现这个语法有效:

q =*:*& fq = (({
            !geofilt sfield = Location pt = 40.68063802521456,
            -74.00390625 d = 80.4672
        }
            AND ClientId : "client1")OR({
            !geofilt sfield = Location pt = 36.1146460,
            -115.1728160 d = 80.4672
        }
            AND ClientId : "client2"))

This is old, but it doesn't seem like it ever got a full answer. I had the same issue and found that this syntax works:

q =*:*& fq = (({
            !geofilt sfield = Location pt = 40.68063802521456,
            -74.00390625 d = 80.4672
        }
            AND ClientId : "client1")OR({
            !geofilt sfield = Location pt = 36.1146460,
            -115.1728160 d = 80.4672
        }
            AND ClientId : "client2"))
倦话 2024-12-15 06:07:43

看起来,您想在一个请求中运行 N 个查询,以便每个查询获得一个结果集?!

所以字段折叠 ( http://wiki.apache.org/solr/FieldCollapsing ) 就是你想要的正在寻找。不幸的是 FieldCollapsing 仅从 3.3 开始可用。

根据您的需求,也许来自不同方面搜索的计数结果也很有用?!

It looks like, you like to run N querys in one request in order to get one result set per query?!

So Field Collapsing ( http://wiki.apache.org/solr/FieldCollapsing ) is what you are looking for. Unfortunately FieldCollapsing is only available from 3.3.

Depending on your needs, maybe counted results from different faceted searches could be also useful?!

攒眉千度 2024-12-15 06:07:43

如果您将第二个位置查询移至附加过滤器查询中,如下所示:

q=*:*&fq={!geofilt}&sfield=位置&(ClientId:"client1"&pt=40.68063802521456,-74.00390625&d=80 .4672)&fq={!geofilt}&sfield=位置&(ClientId:"client2"&pt=36.1146460,-115.1728160&d=80.4672)

这会提供您正在寻找的结果吗?它可能最终限制太多,但认为值得尝试。

您也可以尝试:

q=*:*&fq={!geofilt}&sfield=位置&((ClientId:"client1"&pt=40.68063802521456,-74. 00390625&d=80.4672)%20OR%20(ClientId:"client2"&pt=36.1146460,-115.1728160&d=80.4672))

What if you moved your second location query into an additional filter query, like below:

q=*:*&fq={!geofilt}&sfield=Location&(ClientId:"client1"&pt=40.68063802521456,-74.00390625&d=80.4672)&fq={!geofilt}&sfield=Location&(ClientId:"client2"&pt=36.1146460,-115.1728160&d=80.4672)

Will that provide the results that you are looking for? It might end up being too limiting, but thought it was worth trying.

You might also try:

q=*:*&fq={!geofilt}&sfield=Location&((ClientId:"client1"&pt=40.68063802521456,-74.00390625&d=80.4672)%20OR%20(ClientId:"client2"&pt=36.1146460,-115.1728160&d=80.4672))

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