If you have the locations of each provider, I would tag those with their zip 
codes. Also might tag with zip codes within a certain distance, maybe in a 
different field. That lookup could be slow, because it is at index time.

At query time, search the zip code field(s).

One way to do the neighboring zip codes would be to find what DMA (direct 
marketing area) the address is in, then find the zip codes that are in that DMA.

This thread has some relevant discussion: 
https://www.reddit.com/r/adops/comments/oxdthy/zip_code_to_dma_converter/

wunder
Walter Underwood
wun...@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Dec 14, 2022, at 1:47 PM, Matthew Castrigno <castr...@slhs.org> wrote:
> 
> Yes Walter, zip Codes are marginal at best for determining the closeness of 
> locations.
> The API is used for indexing and searching content of a Sitecore site. Some 
> of the content is about health care providers and their locations.
> From: Walter Underwood <wun...@wunderwood.org <mailto:wun...@wunderwood.org>>
> Sent: Wednesday, December 14, 2022 11:13 AM
> To: users@solr.apache.org <mailto:users@solr.apache.org> 
> <users@solr.apache.org <mailto:users@solr.apache.org>>
> Subject: Re: spatial search by zipcode
>  
> This Message Is From an External Sender 
> This message came from outside the St. Luke's email system. 
> Right. The best you could do is some sort of “center” of the zip code, but 
> they aren’t evenly shaped or similar sizes. 89049 is 10,000 square miles and 
> 11109 is two blocks in NYC.
> 
> 89049 is six disconnected areas.
> 
> https://urldefense.com/v3/__https://www.google.com/maps/place/Tonopah,*NV*89049/@38.51715,-116.8341002,9z/data=!4m5!3m4!1s0x80ba30d165da8f09:0xaf8f27eb9fd93664!8m2!3d38.3675335!4d-115.9467997__;Kys!!FkC3_z_N!KKdYlsIyGSfNY-4_GI5jklwtWiHfB7hEv8lSEuFz8NO9u0VF4n8My-UDoJSQDCP6sa5C6O6r1DBW99wt$
>  
> <https://urldefense.com/v3/__https://www.google.com/maps/place/Tonopah,*NV*89049/@38.51715,-116.8341002,9z/data=!4m5!3m4!1s0x80ba30d165da8f09:0xaf8f27eb9fd93664!8m2!3d38.3675335!4d-115.9467997__;Kys!!FkC3_z_N!KKdYlsIyGSfNY-4_GI5jklwtWiHfB7hEv8lSEuFz8NO9u0VF4n8My-UDoJSQDCP6sa5C6O6r1DBW99wt$>
> 
> What does the current API do, exactly? 
> 
> wunder
> Walter Underwood
> wun...@wunderwood.org <mailto:wun...@wunderwood.org>
> https://urldefense.com/v3/__http://observer.wunderwood.org/__;!!FkC3_z_N!KKdYlsIyGSfNY-4_GI5jklwtWiHfB7hEv8lSEuFz8NO9u0VF4n8My-UDoJSQDCP6sa5C6O6r1B-4q_ax$
>  
> <https://urldefense.com/v3/__http://observer.wunderwood.org/__;!!FkC3_z_N!KKdYlsIyGSfNY-4_GI5jklwtWiHfB7hEv8lSEuFz8NO9u0VF4n8My-UDoJSQDCP6sa5C6O6r1B-4q_ax$>
>   (my blog)
> 
> > On Dec 14, 2022, at 9:37 AM, dmitri maziuk <dmitri.maz...@gmail.com 
> > <mailto:dmitri.maz...@gmail.com>> wrote:
> > 
> > On 2022-12-14 10:45 AM, Matthew Castrigno wrote:
> >> Hi Gus,
> >> Thank you for your reply. I am trying to emulate an existing API that is 
> >> why I am trying to work with the Zipcode directly. After looking at this 
> >> it looks like I will have to do a few things.
> >>   1.  When indexing I will need to index the location in a spatial field 
> >> <fieldType name="location" class="solr.LatLonPointSpatialField" 
> >> docValues="true"/>
> >>   2.  Along with the zipcode (in case just a straight zipcode match is 
> >> desired) I will have to lookup the GPS coordinates of the zipcode and pass 
> >> them as the pt parameter.
> >>   3.  Finally, I will need to use the functional query geodist() to return 
> >> a field that will be the distance from the location in item 1 and the pt 
> >> parameters in item 2.
> > 
> > The point of the url I send earlier is that zipcodes are weird irregular 
> > shapes that don't work well with regular spatial queries. I.e. there is no 
> > such thing as "GPS coordinates of the zipcode" (#2).
> > 
> > Dima
> > 
> 
> "This message is intended for the use of the person or entity to which it is 
> addressed and may contain information that is confidential or privileged, the 
> disclosure of which is governed by applicable law. If the reader of this 
> message is not the intended recipient, you are hereby notified that any 
> dissemination, distribution, or copying of this information is strictly 
> prohibited. If you have received this message by error, please notify us 
> immediately and destroy the related message."

Reply via email to