MS SQL Full Text Search - Ordering on joined “non indexed” column

  • I'm having an FTS with the following conditions.

    SELECT .....
    FROM Database.dbo.addressbook T 
    LEFT OUTER JOIN Database.dbo.favorites F ON T.TargetMail = F.TargetMail
    WHERE 1 = 1 
    AND (@kw1 = '""' OR CONTAINS((T.Company,T.Sn,T.GivenName,T.TargetMail,T.Location),@kw1)) 
    AND (@kw2 = '""' OR CONTAINS((T.Company,T.Sn,T.GivenName,T.TargetMail,T.Location),@kw2))
    ORDER BY F.IsFavourite DESC

    FTS has been enabled on columns T.Company, T.Sn, T.GivenName, T.TargetMail, T.Location in table addressbook. I'm joining a second table called favorites which isn't FTS enabled. I have realized that ordering by F.IsFavourite DESC doesn't work in this scenario. How can i make it work so that i can order by this additional joined column?
    Thanks...

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply