I want to full text search on multiple tables.
Example my strSearch = example full text search engine.
"SELECT TOP (100) PERCENT FT_TBL.Description AS mota, FT_TBL.test1_ID, KEY_TBL.RANK
FROM dbo.test1 AS FT_TBL INNER JOIN
CONTAINSTABLE(test1, *, '"+strSearch+"') AS KEY_TBL ON FT_TBL.test1_ID = KEY_TBL.[KEY]
UNION ALL
SELECT TOP (100) PERCENT FT_TBL1.Description1 AS mota, FT_TBL1.test2_ID, KEY_TBL1.RANK
FROM dbo.test2 AS FT_TBL1 INNER JOIN
CONTAINSTABLE(test2, *, '"+strSearch+"') AS KEY_TBL1 ON FT_TBL1.test2_ID = KEY_TBL1.[KEY]"
I want to show results order such as GOOGLE: show top records full keyword "example full text search engine", then continune left phrases.
pls help me
You want to try freetexttable. If all words are found in a row, the row is given higher rank. However, there is no garantee that the full phrase is getting better scan than a partial match (for example, if there are several partial matches found)
If you want a match exactly the phrase, you need to do a phrase search. Probably you want to do a phrase search union freetext table?
Rank from different tables generally are not comparable. You can create an indexed view of the two table and build fulltext index over the indexed view to get comparable ranking.
没有评论:
发表评论