[wp-hackers] Search Results based on Geodata

Mike Schinkel mikeschinkel at newclarity.net
Sat Jun 5 21:36:01 UTC 2010


I've retitled this, but on same thread.

On Jun 5, 2010, at 5:06 PM, Beau Lebens wrote:
> I would suggest that this would definitely be plugin territory, but
> that the groundwork to making it more possible/useful would be making
> sure that anything/everything that was going to work with geo data was
> at least storing it in the same place.

It would be useful to have some small stubs in core that do the storing and retrieving; code gets people following a standard so much better than posted best practices.

> You should be able to (totally guessing here) filter search queries to
> do something like this, once you know where to look for the
> appropriate geodata (might require an external index of some sort, i
> don't have much experience with searching on geo data myself).

So the problem I'm getting stuck on is that every point someone might search from is potentially a different index and thus it seems that every search result would need to be generated by a very slow sequential scan of the database.  The best I can come up with is to build ad-hoc records in an table used for indexing that contains a subset of data that is near the geo point by a square grid, "index" those by the distance from my geo point, then cache the results for 24 hours from the last time someone needed them.  Has anyone got a better way?  (I'm really hoping I'm missing something very obvious here.)

BTW, if there is a good way to do index results based on geo and if geo data were to be included in core then having the searches available to work with geo might be something to consider adding to core. FWIW.

-Mike


More information about the wp-hackers mailing list