Implementing a simple 'Full Text Search' like tables would be a way.
CREATE TABLE YourTable (id int, subject varchar(256), content varchar(8000))
CREATE TABLE Keywords (key_id int, keyw varchar(50), relevanceModifier float)
CREATE TABLE SubjectsKeywords (key_fk int, yourTable_fk int, quantity int)
CREATE TABLE ContentKeywords (key_fk int, yourTable_fk int, quantity int)
When you insert in YourTable, fire a trigger to:
Split subject and content columns by spaces, commas, etc into words.
Optionally, avoid "stop words" like "the", "they", "to", etc. This is called stemming if i'm not mistaken.
Each word should be inserted in tables SubjectsKeywords, ContentKeywords and Keywords.
Optionally, set relevanceModifier. A very simple criteria would be to use the string length.
Optionally, count each ocurrence and track it quantity fields.
Then your query would be like this:
select max(t.relevance), yourtable.id, MAX([subject]), MAX(content)
from
(
/* exact match and 'contains' match */
select 100 as relevance, id
from YourTable
where [subject] like '%search this keywords%'
UNION
/* keyword match */
select 70 as relevance, yt.id
from YourTable as yt
join SubjectsKeywords on id = yourTable_fk
join Keywords as k on k.id = key_fk
where keyw in ('search', 'this', 'keywords')
UNION
select 40 as relevance, id
from YourTable
where [subject] like '%search this keywords%'
UNION
select 10 as relevance, yt.id
from YourTable as yt
join ContentKeywords on yt.id = yourTable_fk
join Keywords as k on k.id = key_fk
where keyw in ('search', 'this', 'keywords')
) as T
join yourtable on t.id = yourtable.id
group by t.id
order by max(relevance) desc
, yourtable.id ASC /*So that the result will always be in the same order*/
Notes:
Trigger is a way to do it if you have little control of you application or if it is a maintenance nightmare.
Later it you could improve it by adding a soundex, so that, you can search even mispelled keywords.
RelevanceModifier, Quantity field can be use to calculate more relevant results.
As it may be fast enough, it may be usefull as an autocomplete feature for your application, in which case you'd like to limit the results to let say 256 at most.
I hope this gives you and idea, and so you decide what suits you best.