I am using the location module. The location/proximity search works well..

Do the Drupal Search and Location's Proximity Search work together, on one page? I want to enter a search keyword AND provide a ZIP code...

Is this possible??

Thank you in advance
Ethan Z.

Comments

yrre7’s picture

I second that

yesct’s picture

Category: support » feature
Status: Active » Postponed
Issue tags: +location cool idea

I dont this this will work together. I'm really not sure, but this sounds a bit to me like faceted search. You might search for more information about faceted search and drupal together in general.

I'll mark this as a feature request and postpone it. Because it sounds like a cool idea, but there are some things in this module that probably need to be fixed first.

david.a.king’s picture

Does this mean that it's currently not possible to search for "Dentist" near "[postcode]" and have all nodes tagged with "dentist" listed in order of proximity to [postcode]?

or am i misunderstanding?

rc2020’s picture

The only way to do it is to run a search with views using a proximity filter being able to accept lat/long as either arguments or php input. We hacked the location filter to take php input run through a module-defined function, which works excellently well. However, you gotta create a ton of html form infrastructure to take $_POST elements, pass them into functions, query a lat/long from the db, and spit it out to the function to use in views. It's definitely doable, but it's surely not easy.

rc2020’s picture

I also did it on 6x

david.a.king’s picture

hmm, ok.. is there any documentation on doing it? i'm not so hot on such in-depth stuff..

i'm also using 6.x

what makes this hard to do? in my ignorance it sounds like it should be simple.. i mean if you can return all nodes in order of proximity, why can't you filter those nodes?

thanks

rc2020’s picture

You need to be able to have the distance/proximity filter accept auxillary input. It only accepts a lat/long in a static format. You can expose it to the user, but that's useless, as nobody knows the lat/long of a place. You need a method to convert the city/state into a lat/long. I wrote a module to do this, taking the city and state value, and querying the datebase to return a lat/long for that city and state.

You'd not only need that, but you also need the ability for the proximity filter to accept dynamic input, which is only done with a php function which you'd have to write. So in addition to writing code to make the form elements to take in a city and state and desired search distance, you'd also need to write the module to query the DB to provide a lat/long from a city state, and from there, hack the views proximity handle.inc to accept a php function. In short: This is not an ideal approach.

Realistically, views arguments need to be provided to make this functionality happen in a stable fashion. I just hacked my way to success.

Check this support tag here: http://drupal.org/node/357295

You'll notice it has about 60 responses, and it's been going on for about 20 weeks.

Feel free to chime in on it, and try to see if you can make it move any further, but I wouldn't hold your breath.

Good luck...

david.a.king’s picture

hey, hacking/bodging's all good in my book if it gets something working..

Just to clarify though, the method you used does incorporate keyword or tag searches too, right?

i see in the linked thread you mention sharing your hack - i'd certainly be interested!

in anticipation of this being rather tricky i've also posted a request for paid help http://drupal.org/node/608060 - perhaps i should add a "dirty hacks accepted" note!

rc2020’s picture

Hey David,

Yes.
It actually is designed to work with the location taxonomy/term panels page, so it's integrated into taxonomy. The thing is, I did it for US databases. Shoot me an email at cmacpher at gmail dot com, I do commercial projects as well, and if you give me an idea of what you want to do I'll see what I can do configure it for you.

Thanks,

CR

ankur’s picture

Status: Postponed » Closed (fixed)

If there's still a desire to use some kind of proximity as a facet on a keyword search, I'd suggest using Solr and perhaps one of the following :

http://drupal.org/project/spatialsolr
http://drupal.org/project/localsolr

Both of these, however, look pretty experimental.