You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "David Smiley (Jira)" <ji...@apache.org> on 2021/01/31 15:42:00 UTC
[jira] [Comment Edited] (SOLR-15084) Multiple Fields in Polygon
Intersection query
[ https://issues.apache.org/jira/browse/SOLR-15084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275919#comment-17275919 ]
David Smiley edited comment on SOLR-15084 at 1/31/21, 3:41 PM:
---------------------------------------------------------------
I'm going to close this as "Not a Problem" both because this feels more like a user-list question and also, if it's a feature request, I don't see it happening. Next time, do ask there first if you have a question.
If you have many fields you want to search with the same query, especially for filtering (not scoring), you should add a new field that is the target of multiple copyFields, and then you can efficiently search just this one. If that's not feasible for your use-case (perhaps if the particular fields you want to search varies), you could search many fields with the same query; Solr has no limit on how many fields you search. The query for this would be something like this (not tested):
{noformat}
&fq={!bool
should='{!field f=geo1 v=$geom}'
should='{!field f=geo2 v=$geom}'
}
&geom=Intersects(POLYGON(...))
{noformat}
Maybe it's necessary to put a quote around each $geom reference; not sure. You will find Solr's "Query DSL" much friendlier for this scenario: [https://lucene.apache.org/solr/guide/7_1/json-query-dsl.html]
Good luck!
was (Author: dsmiley):
I'm going to close this as "Not a Problem" both because this feels more like a user-list question and also, if it's a feature request, I don't see it happening. Next time, do ask there first if you have a question.
If you have many fields you want to search with the same query, especially for filtering (not scoring), you should add a new field that is the target of multiple copyFields, and then you can efficiently search just this one. If that's not feasible for your use-case (perhaps if the particular fields you want to search varies), you could search many fields with the same query; Solr has no limit on how many fields you search. The query for this would be something like this (not tested):
{{fq=\{!bool should='{!field f=geo1 v=$geom}' should='\{!field f=geo2 v=$geom}'}&geom=Intersects(...)}}
Maybe it's necessary to put a quote around each $geom reference; not sure. You will probably find Solr's "Query DSL" much friendlier for this scenario: [https://lucene.apache.org/solr/guide/7_1/json-query-dsl.html]
Good luck!
> Multiple Fields in Polygon Intersection query
> ---------------------------------------------
>
> Key: SOLR-15084
> URL: https://issues.apache.org/jira/browse/SOLR-15084
> Project: Solr
> Issue Type: Wish
> Security Level: Public(Default Security Level. Issues are Public)
> Affects Versions: 7.6
> Reporter: Kevin Van Lieshout
> Priority: Major
>
> Does solr 7 support multiple fields being searched at once in a JTS intersection query like:
> {{&q=*:*&fq=\{!field f=geo}Intersects(POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30)))}}
> {{where you could search this intersection on all geo fields within a collection?}}
> Something as simple as below if a collection had 2 spatial field --> geo1, geo2:
> {{&q=*:*&fq=\{!field f=geo1 OR f=geo2}Intersects(POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30)))}}
> {{}}
> {{If this doesn't exist, it would be incredible functionality to avoid multiple solr queries where you could search all geo fields under 1 intersection query. Thanks}}
> {{}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org