searching LIKE across numerous fields
Posted 13 March 2006 - 04:39 PM
For example, 123 E. Main St. is separated into four separate fields. The number, direction (east), street name, and street type (like street, boulevard, avenue, etc).
So, if I have a single search field where they can type "123 Main" I'd like it to combine the four fields in a single search. Does that make sense?
The other option is to make a separate "combined" field in the database where I run the four address fields together on import.
Is there a mysql solution, or do I need to create the separate field?
Posted 13 March 2006 - 07:48 PM
Hope that helps.
Posted 14 March 2006 - 12:24 AM
SELECT * FROM `listings` WHERE MATCH ( STREET_NUM, STREET_NAME ) AGAINST ( '+7653 +Cameron' IN BOOLEAN MODE ); #1064 - You have an error in your SQL syntax near 'BOOLEAN MODE)' at line 1
Posted 30 March 2006 - 04:00 PM
It was a single command on the command line ("yum upgrade mysql"), followed by a tweak of the /etc/my.cnf file.
After much nail biting, and hair standing up on the back of my neck, etc, it actually turned out to be very simple and completely pain free.
Anyway, the indexing works better than I could have imagined, thanks for the help.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users