a_slosh — 2005-12-24T00:20:16-05:00 — #1
I am working on a search engine (see thread) for a university book store. I was having a problem with relevance but have found a solution (using fulltext searches) to almost everything problem except one:
I would like to include a value that says if the column 'uni' is like the specified string then return a value of 2 otherwise 0. This will then be added to the sum of relvancy scores from other fields.
i.e. I would like my total relevance field to be (where "mq" is the university code provided from the search form)
MATCH(title) AGAINST('blah')....+MATCH....+(uni LIKE '%mq%' ? 2 : 0) AS totalRelevance
Is this possible in any way?
r937 — 2005-12-24T00:24:55-05:00 — #2
change this -- (uni LIKE '%mq%' ? 2 : 0)
to this -- case when uni LIKE '%mq%' then 2 else 0 end
a_slosh — 2005-12-24T01:20:46-05:00 — #3
Thanks r937 - you're like a walking SQL dictionary