PHP and MySQL search across multiple columns
2 answers
You might want to consider expanding the table and chopping it off a bit. Take all your varchar columns and store the data in one table "Search_Strings"; do the same for int columns:
original table
id
always_field1
always_field2
varstring1
...
varstringx
int1
...
inty
new main_table (same number of rows as original table, but very few columns)
id
always_field1
always_field2
Search_Strings (
id (FK to main_table)
old_column_name
string_value
Search_Ints
id (FK to main_table)
old_column_name
int_value
With this setting, you only need the full text for string_value. Sorry, I cannot suggest anything with the Sphinx or Lucena as I am not familiar with them.
0
source to share