I present videos on my site. The videos' details are stored in two MySQL InnoDB tables:
Video_Table video_id
category_id (foreign key constraint)
video_title
video_description
video_thumbnail
video_views
Category_Table category_id
category_name
I want to add a search feature to my site so that users can search for specific videos. I want the script to search through:
video_title (UNIQUE index)
video_description (no index)
and present any videos that match the search query.
The best way to do this would be to add FULLTEXT indexes to these columns, but I can't because FULLTEXT indexes are not available on my version of MySQL, and I can't upgrade to the version that supports them (5.6.4) because I'm on shared hosting. :-/
Questions - What should I do? Should I keep everything as it is and just use LIKE '%...%' statements? Note that, with just 3,000 rows, my video table is relatively small, and I doubt that it'll grow more than 8,000 rows.
- Should I add an index to video_description? If so, what kind?
- How should I prepare the search queries? I don't want to just do this: "SELECT ... WHERE (video_title LIKE '%.$query.%') OR (video_description LIKE '%.$query.%')"