Multimedia searching

I want to be able to search multimedia data stored in the database with
Ruby on Rails application. Any ideas on how I can go about this or tools
you have heard of?