Gavin
Gavin

Reputation: 17382

SQL Server ContainsTable not finding partial matches

I'm trying to use ContainsTable to return a ranked list of results.

I have it working fine when it finds a whole word match but its doesnt seem to work for partial words. For example if I search for 'acq' it wont find 'Acquisitions'. I really need it to work with partial matches for it to be useful. Using "Like" is not an option as the results need to be weighted.

SELECT
    TitleRanks.RANK,
    CourseId,
    CourseTitle         
FROM
    TBL_LMS_CLIENT_COURSES as Courses
    INNER JOIN CONTAINSTABLE(Courses,CourseTitle,'acq') AS TitleRanks 
        ON Courses.CourseId = TitleRanks.[key]      

Any ideas would be great.

Thanks

Upvotes: 2

Views: 2911

Answers (1)

Andrew
Andrew

Reputation: 27294

Does the scenario prevent you using a prefix term in the contains clause?

 INNER JOIN CONTAINSTABLE(Courses,CourseTitle,'"acq*"') 

Upvotes: 5

Related Questions