Hi all, i have a query below that im testing, and have a couple questions.
1. FREETEXT and CONTAINS seem to have different results, i would like a combo of both somehow! FREETEXT seems to allow plurals to result (test retuns tests), CONTAINS allows me to return (this & that). Whats the best way to combine both features?
2. CONTAINS doesnt like my @search variable below
- Syntax error near 'state' in the full-text search condition 'correct state'.
a. is the word "state" a buzzword for CONTAINS?
b. i can change it to "correct & state" and i get "my correct state" but not "correct your state"
c. FREETEXT returns all "correct" and all "state"
1. FREETEXT and CONTAINS seem to have different results, i would like a combo of both somehow! FREETEXT seems to allow plurals to result (test retuns tests), CONTAINS allows me to return (this & that). Whats the best way to combine both features?
2. CONTAINS doesnt like my @search variable below
- Syntax error near 'state' in the full-text search condition 'correct state'.
a. is the word "state" a buzzword for CONTAINS?
b. i can change it to "correct & state" and i get "my correct state" but not "correct your state"
c. FREETEXT returns all "correct" and all "state"
Code:
--only 1 catalog, with only 2 columns indexed (HistNotes and HistDetails)
DECLARE @search varchar(200)
SET @search = 'correct state'
SELECT t1.*
FROM tblHistory t1
WHERE FREETEXT(*, @search)
ORDER BY t1.HistDate DESC
SELECT t1.*
FROM tblHistory t1
WHERE CONTAINS(*, @search)
ORDER BY t1.HistDate DESC