CouchSearch

From the CouchSurfing Wiki, an informal workspace which anyone can edit.

(Redirected from Search.lib and place.lib)
Jump to: navigation, search

THIS PAGE IS OUTDATED

Now you're rocking with the Tech team
( documentsstatusmeetingswhy we work on CS )

Please see my latest search thing at:

   www.couchsurfing.com/search.html

It recognizes strings like "paris", "nelzon nz", "athens", "greece", "california", "san jose california", etc.

This does make the location bug less painful for couchsearch. But if you type, say, "love us", it gives you a list of all US cities named "love" and you have to pick. Right now, the disambiguation list is by state:

   * Love, Illinois, United States
   * Love, Texas, United States
   * Love, Arizona, United States
   * Love, Kentucky, United States
   * Love, Mississippi, United States
   * Love, Virginia, United States

Which doesn't work so well if the states are wrong.

The search code is in "search.lib", function "search_for_place($string)" returns an array of place objects.

Place objects are defined in "place.lib". Places can be cities, states, or countries, and they know how to search for users near or inside them, and how to display themselves, etc.

We could use this stuff in other places where traditionally a Region>Country>State>City is entered: editprofile, etc. It works pretty well, and you can feel free to plug it in in other places.

--Joe

Personal tools