I have 2 tables to search. Searching photos for keywords, title and description. The keywords have been split off into a separate table. My advanced search will allow searching on all 3 but the basic will just be the keyword table.
Basic table setup:
PHOTO Table
- PhotoID
- Name
- Title
- Description
WORD2PHOTO Table
- WordID
- PhotoID
- Word
Been trying views and stored procs, and not getting any good results. I get my pics from the views, but in multiple records. I would do filtering and that stuff on the app side, but I'm using subsonic and would like to use the built in paging; that's a whole other issue.
First, How do I search on multiple keywords? Second, how do I add in searching on the title and description?
I have a function (f_Split) that will return a temp table of my current words to search,
DECLARE @Words TABLE (Word varchar(20))
INSERT INTO @Words (Word)
SELECT Keyword FROM dbo.f_Split('cars|auto|red|fast','|')
Now how do I use the table it generates to get the photo records? Been struggling for days now? Thanks for any help.