I have a table that is Full Text indexed, on which I query using FREETEXT
.
The table is filled from other tables that have constant data, rarely changed.
Now there are few millions of rows.
Table structure:
ID (identity), PK
Text (varchar), FT IX
ForeignID (int) -- of the original ID in it's original table
I'm not satisfied with the results, because sometimes a word is repeated too many times and therefore the row gets high ranked by the engine. Example: "Gas Station Young, Young street, Some State" is higher than "Young street" for searching "young". Ranking a table is enough (no need to rank rows inside the table besides what the FTS index already does).
I want to add a simple custom ranking mechnism.
I've tried adding a CustomRank
column to order by while/ before querying with FREETEXT
but it takes too long. The execution plan says that sorting by CustomRank
is the weakest link in the chain.
I thought about:
- Managing another field, so I would have one for display (
DisplayText
) and one for query/ index (IndexText
), and manipulating the query/ index, by repeating words and phrases for rows that I want to promote. - Splitting it to tables and deal with it in the code. Each table will get it's own rank.
Any ideas? Thanks, Wanger.