I have a ColdFusion 10-based GIS application with a search form. One of the searches that can be performed is an address search. Address data is stored in an enterprise database that I can't alter, so I have to work with it the way it is.
Addresses are broken apart into six separate database columns, not counting the city, state or zip code. Not every address uses every one of the six columns, but some use as many as five of them. Anyway, the search form currently is rather cumbersome as users have to enter pieces of the address into different form fields. It works, but as I said, it's cumbersome. I decided to try to see if I could use Solr to do more intelligent address searches from one form field, ala Google or Yahoo maps. I created a collection on my dev server. I wrote a query that assembled the six pieces into a single address column, then used <cfindex> to put the query results into the index (I put the address column into the body attribute of <cfindex>). Last, I wrote a simple one field form to perform the search. This seems to work, but it pulls back a horrifically large amount of results of dubious match quality. For example, a search using "1234 Main St" (fictitious example address to protect the innocent) returned 34,040 rows out of 123,000 address records. The reason? It's finding matches to any single piece of the search string. From the ColdFusion docs, it looks like I might be able to tighten up the search results by prefixing each "piece" of the search criteria with a "+" character. However, that will force exact matches (except when the street name is also the city name, such as Oakland Blvd in the city of Oakland), and I'd like to keep a little bit of "fuzzy" search capability for typos and such (like Google does). Has anyone played around with parsing addresses and assembling an optimized Solr search? I'm hoping to save some time on experimentation. Thanks, Carl V. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353005 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm