Re: Re: Need urgent help with Solr spatial search using SpatialRecursivePrefixTreeFieldType
Do you know how URLs are structured? They include name=value pairs separated by ampersands. This takes precedence over the contents of any particular name or value. Consequently looking at your parenthesis doesn't make sense since the open-close span ampersands and thus go to different filter queries. I think you can completely remove those parenthesis in fact. Also try a tool like Postman to compose your queries rather than direct URL manipulation. =adminLatLon =80 = {!geofilt pt=33.0198431,-96.6988856} OR {!geofilt pt=50.2171726,8.265894} Notice the leading space after 'fq'. This is a syntax parsing gotcha that has to do with how embedded queries are parsed, which is what you need to do as you need to compose two with an operator. It'd be kinda awkard to fix that gotcha in Solr. There are other techniques too, but this is the most succinct. ~ David Smiley Apache Lucene/Solr Search Developer http://www.linkedin.com/in/davidwsmiley On Tue, Oct 1, 2019 at 7:34 AM anushka gupta < anushka_gu...@external.mckinsey.com> wrote: > Thanks, > > Could you please help me in combining two geofilt fqs as the following > gives > error, it treats ")" as part of the d parameter and gives error that > 'd=80)' > is not a valid param: > > > ({!geofilt}=adminLatLon=33.0198431,-96.6988856=80)+OR+({!geofilt}=adminLatLon=50.2171726,8.265894=80) > > > > -- > Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html >
Re: Re: Need urgent help with Solr spatial search using SpatialRecursivePrefixTreeFieldType
Thanks, Could you please help me in combining two geofilt fqs as the following gives error, it treats ")" as part of the d parameter and gives error that 'd=80)' is not a valid param: ({!geofilt}=adminLatLon=33.0198431,-96.6988856=80)+OR+({!geofilt}=adminLatLon=50.2171726,8.265894=80) -- Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: Re: Need urgent help with Solr spatial search using SpatialRecursivePrefixTreeFieldType
"sort" is a regular request parameter. In your non-working query, you specified it as a local-param inside geofilt which isn't where it belongs. If you want to sort from two points then you need to make up your mind on how to combine the distances into some greater aggregate function (e.g. min/max/sum). ~ David Smiley Apache Lucene/Solr Search Developer http://www.linkedin.com/in/davidwsmiley On Mon, Sep 30, 2019 at 10:22 AM Anushka Gupta < anushka_gu...@external.mckinsey.com> wrote: > Hi, > > > > I want to be able to filter on different cities and also sort the results > based on geoproximity. But sorting doesn’t work: > > > > > admin_directory_search_geolocation?q=david=({!geofilt+sfield=adminLatLon+pt=33.0198431,-96.6988856+d=80+sort=min(geodist(33.0198431,-96.6988856))})+OR+({!geofilt+sfield=adminLatLon+pt=50.2171726,8.265894+d=80+sort=min(geodist(50.2171726,8.265894))}) > > > > Sorting works fine if I add ‘&’ in geofilt condition like : > q=david={!geofilt=adminLatLon=33.0198431,-96.6988856=80=geodist(33.0198431,-96.6988856)} > > > > But when I combine the two FQs then sorting doesn’t work. > > > > Please help. > > > > > > Best regards, > > Anushka gupta > > > > > > > > *From:* David Smiley > *Sent:* Friday, September 13, 2019 10:29 PM > *To:* Anushka Gupta > *Subject:* [EXT]Re: Need urgent help with Solr spatial search using > SpatialRecursivePrefixTreeFieldType > > > > Hello, > > > > Please don't email me directly for public help. CC is okay if you send it > to solr-user@lucene.apache.org so that the Solr community can benefit > from my answer or might even answer it. > > > ~ David Smiley > > Apache Lucene/Solr Search Developer > > http://www.linkedin.com/in/davidwsmiley > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.linkedin.com_in_davidwsmiley=DwMFaQ=yIH1_-b1hO27QV_BdDph9suDL0Jq0WcgndLmIuQXoms=0egJOuVVdmY5VQTw_S3m4bVez1r-U8nqqi6RYBxO6tTbzryrDHrFoJROJ8r-TqNc=ulu2-5V3TDOnVNfRRQusod6-FoJcdeAWu5gGB3owryU=Hv2uYeXnut3oi1ijHp14BJ09QIZzhEI-onwzhnQYB8I=> > > > > > > On Wed, Sep 11, 2019 at 11:27 AM Anushka Gupta < > anushka_gu...@external.mckinsey.com> wrote: > > Hello David, > > > > I read a lot of articles of yours regarding Solr spatial search using > SpatialRecursivePrefixTreeFieldType. But unfortunately it doesn’t work for > me when I combine filter query with my keyword search. > > > > Solr Version used : Solr 7.1.0 > > > > I have declared fields as : > > > > class="solr.SpatialRecursivePrefixTreeFieldType" geo="true" > maxDistErr="0.001" > > distErrPct="0.025" > distanceUnits="kilometers"/> > > > > stored="true" multiValued="true" /> > > > > > > Field values are populated like : > > adminLatLon: [50.2171726,8.265894] > > > > Query is : > > > /solr/ac3_persons/admin_directory_search_location?q=Idstein=Idstein={!geofilt%20cache=false%20cost=100}=adminLatLon=50.2171726,8.265894=500=recip(geodist(),2,200,20)=true > > > > My request handler is : > > admin_directory_search_location > > > > I get results if I do : > > /solr/ac3_persons/admin_directory_search_location?q=*:* > =Idstein={!geofilt%20cache=false%20cost=100}=adminLatLon=50.2171726,8.265894=500=recip(geodist(),2,200,20)=true > > > > But I do not get results when I add any keyword in q. > > > > I am stuck in this issue since last many days. Could you please help with > the same. > > > > > > Thanks, > > Anushka Gupta > > > > ++ > This email is confidential and may be privileged. If you have received it > in error, please notify us immediately and then delete it. Please do not > copy it, disclose its contents or use it for any purpose. > ++ > > ++ > This email is confidential and may be privileged. If you have received it > in error, please notify us immediately and then delete it. Please do not > copy it, disclose its contents or use it for any purpose. > ++ >
Re: Re: Need urgent help with Solr spatial search using SpatialRecursivePrefixTreeFieldType
https://stackoverflow.com/questions/48348312/solr-7-how-to-do-full-text-search-w-geo-spatial-search On Mon, Sep 30, 2019 at 10:31 AM Anushka Gupta < anushka_gu...@external.mckinsey.com> wrote: > Hi, > > I want to be able to filter on different cities and also sort the results > based on geoproximity. But sorting doesn’t work: > > > admin_directory_search_geolocation?q=david=({!geofilt+sfield=adminLatLon+pt=33.0198431,-96.6988856+d=80+sort=min(geodist(33.0198431,-96.6988856))})+OR+({!geofilt+sfield=adminLatLon+pt=50.2171726,8.265894+d=80+sort=min(geodist(50.2171726,8.265894))}) > > Sorting works fine if I add ‘&’ in geofilt condition like : > q=david={!geofilt=adminLatLon=33.0198431,-96.6988856=80=geodist(33.0198431,-96.6988856)} > > But when I combine the two FQs then sorting doesn’t work. > > Please help. > > > Best regards, > Anushka gupta > > > > From: David Smiley > Sent: Friday, September 13, 2019 10:29 PM > To: Anushka Gupta > Subject: [EXT]Re: Need urgent help with Solr spatial search using > SpatialRecursivePrefixTreeFieldType > > Hello, > > Please don't email me directly for public help. CC is okay if you send it > to solr-user@lucene.apache.org<mailto:solr-user@lucene.apache.org> so > that the Solr community can benefit from my answer or might even answer it. > > ~ David Smiley > Apache Lucene/Solr Search Developer > http://www.linkedin.com/in/davidwsmiley< > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.linkedin.com_in_davidwsmiley=DwMFaQ=yIH1_-b1hO27QV_BdDph9suDL0Jq0WcgndLmIuQXoms=0egJOuVVdmY5VQTw_S3m4bVez1r-U8nqqi6RYBxO6tTbzryrDHrFoJROJ8r-TqNc=ulu2-5V3TDOnVNfRRQusod6-FoJcdeAWu5gGB3owryU=Hv2uYeXnut3oi1ijHp14BJ09QIZzhEI-onwzhnQYB8I= > > > > > On Wed, Sep 11, 2019 at 11:27 AM Anushka Gupta < > anushka_gu...@external.mckinsey.com anushka_gu...@external.mckinsey.com>> wrote: > Hello David, > > I read a lot of articles of yours regarding Solr spatial search using > SpatialRecursivePrefixTreeFieldType. But unfortunately it doesn’t work for > me when I combine filter query with my keyword search. > > Solr Version used : Solr 7.1.0 > > I have declared fields as : > > class="solr.SpatialRecursivePrefixTreeFieldType" geo="true" > maxDistErr="0.001" > distErrPct="0.025" > distanceUnits="kilometers"/> > > stored="true" multiValued="true" /> > > > Field values are populated like : > adminLatLon: [50.2171726,8.265894] > > Query is : > > /solr/ac3_persons/admin_directory_search_location?q=Idstein=Idstein={!geofilt%20cache=false%20cost=100}=adminLatLon=50.2171726,8.265894=500=recip(geodist(),2,200,20)=true > > My request handler is : > admin_directory_search_location > > I get results if I do : > > /solr/ac3_persons/admin_directory_search_location?q=*:*=Idstein={!geofilt%20cache=false%20cost=100}=adminLatLon=50.2171726,8.265894=500=recip(geodist(),2,200,20)=true > > But I do not get results when I add any keyword in q. > > I am stuck in this issue since last many days. Could you please help with > the same. > > > Thanks, > Anushka Gupta > > ++ > This email is confidential and may be privileged. If you have received it > in error, please notify us immediately and then delete it. Please do not > copy it, disclose its contents or use it for any purpose. > ++ > > ++ > This email is confidential and may be privileged. If you have received it > in error, please notify us immediately and then delete it. Please do not > copy it, disclose its contents or use it for any purpose. > ++ >
RE: Re: Need urgent help with Solr spatial search using SpatialRecursivePrefixTreeFieldType
Hi, I want to be able to filter on different cities and also sort the results based on geoproximity. But sorting doesn’t work: admin_directory_search_geolocation?q=david=({!geofilt+sfield=adminLatLon+pt=33.0198431,-96.6988856+d=80+sort=min(geodist(33.0198431,-96.6988856))})+OR+({!geofilt+sfield=adminLatLon+pt=50.2171726,8.265894+d=80+sort=min(geodist(50.2171726,8.265894))}) Sorting works fine if I add ‘&’ in geofilt condition like : q=david={!geofilt=adminLatLon=33.0198431,-96.6988856=80=geodist(33.0198431,-96.6988856)} But when I combine the two FQs then sorting doesn’t work. Please help. Best regards, Anushka gupta From: David Smiley Sent: Friday, September 13, 2019 10:29 PM To: Anushka Gupta Subject: [EXT]Re: Need urgent help with Solr spatial search using SpatialRecursivePrefixTreeFieldType Hello, Please don't email me directly for public help. CC is okay if you send it to solr-user@lucene.apache.org<mailto:solr-user@lucene.apache.org> so that the Solr community can benefit from my answer or might even answer it. ~ David Smiley Apache Lucene/Solr Search Developer http://www.linkedin.com/in/davidwsmiley<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.linkedin.com_in_davidwsmiley=DwMFaQ=yIH1_-b1hO27QV_BdDph9suDL0Jq0WcgndLmIuQXoms=0egJOuVVdmY5VQTw_S3m4bVez1r-U8nqqi6RYBxO6tTbzryrDHrFoJROJ8r-TqNc=ulu2-5V3TDOnVNfRRQusod6-FoJcdeAWu5gGB3owryU=Hv2uYeXnut3oi1ijHp14BJ09QIZzhEI-onwzhnQYB8I=> On Wed, Sep 11, 2019 at 11:27 AM Anushka Gupta mailto:anushka_gu...@external.mckinsey.com>> wrote: Hello David, I read a lot of articles of yours regarding Solr spatial search using SpatialRecursivePrefixTreeFieldType. But unfortunately it doesn’t work for me when I combine filter query with my keyword search. Solr Version used : Solr 7.1.0 I have declared fields as : Field values are populated like : adminLatLon: [50.2171726,8.265894] Query is : /solr/ac3_persons/admin_directory_search_location?q=Idstein=Idstein={!geofilt%20cache=false%20cost=100}=adminLatLon=50.2171726,8.265894=500=recip(geodist(),2,200,20)=true My request handler is : admin_directory_search_location I get results if I do : /solr/ac3_persons/admin_directory_search_location?q=*:*=Idstein={!geofilt%20cache=false%20cost=100}=adminLatLon=50.2171726,8.265894=500=recip(geodist(),2,200,20)=true But I do not get results when I add any keyword in q. I am stuck in this issue since last many days. Could you please help with the same. Thanks, Anushka Gupta ++ This email is confidential and may be privileged. If you have received it in error, please notify us immediately and then delete it. Please do not copy it, disclose its contents or use it for any purpose. ++ ++ This email is confidential and may be privileged. If you have received it in error, please notify us immediately and then delete it. Please do not copy it, disclose its contents or use it for any purpose. ++