I have a request from a client who wants to be able to prioritize their product SKU in the search results. The SKU is in the defined key CF_TITLE. I'm not very good with verity and the documentation isn't great out there. I managed to modify it to find only the CF_TITLE but it affected the rest of the results. I'm also not sure the current criteria is correct either since it doesn't really follow any example syntax I've found.
So how can I modify the criteria so we can prioritize an exact match for "CF_TITLE" in the results without effecting the rest of the results?
This is their current search tag:
<cfsearch
collection="company"
name="SearchResults"
criteria="(<NOT> CF_KEY <MATCHES> #SearchKeywords#)
AND (#SearchKeywords#)"
status="Info">
Since Verity determines relevance largely based on the number of occurrences of the criteria, one way to "prioritise" results would be to artificially append the SKU multiple times to the "body" when indexing the collection.
You could do this either in your original SQL query, or you could use ColdFusion to massage the resultset to pad it with the SKUs before passing it to Verity. Here's an example of the latter option:
Note the semi-colon separating the the extra SKUs, this ensures Verity will match them as separate occurrences.
I've used 5 as an example number, but you might start with just 2 and tune it upwards until you see the results you want.