Help with TextSearch :all and MySQL


#1

Hi,

I really need help with making the ‘searches_on :all’ in Duane J.'s
TextSearch work with MySQL (not sure if it works with other db’s).

http://wiki.rubyonrails.com/rails/pages/TextSearch

I realize that there are other search packages out there. But this
particular solution best fits my small needs of searching a small
database.

I’ve gotten it to work when specifying the specific table column names:

searches_on :title :address :foobar

But due to the nature of my application which switches primary db tables
based on user choice, I really need the dynamism of ‘searches_on :all’
to work so that search functionality works with any table (where column
names differ).

I’ve been studying the code of Duane’s ‘search.rb’, but cannot find the
bug that stops ‘:all’ from working.

Can somebody please suggest a fix?

Thank you!

Matt


Matt C. Wagner
Information Security Analyst

Network Intrusion Detection
Security Operations Center
Corporate Information Security
Wells Fargo Bank


#2

On Jan 6, 2006, at 10:09 AM, removed_email_address@domain.invalid
removed_email_address@domain.invalid wrote:

database.
column
Matt

Hi Matt,

I’m not sure what the exact problem is, but I do have one suggestion:
try removing the ‘searches_on’ altogether and see if the default
“just works”. If I remember correctly, the searches_on was an
afterthought because my particular need was to search everything
automatically, like yours.

If that doesn’t work, can you help me understand what’s happening
(or not happening), e.g. logs or otherwise? It might help if you
could send some query strings to the log, too–just to see what it’s
doing underneath.

Duane J.
(canadaduane)
http://blog.inquirylabs.com/