MS SQL query syntax for full text search
-
Hii, I have a table in a database called dictionary. I have four columns namely id, word , keyword and meaning. I have indexed word, keyword and meaning column in a catalog for full text searching of any word. I want full text searching of any word in these two column and return meaning of that word found in word and keyword column. I searched the table for the word using following query :
string wordSearched=textBox1.Text;
"SELECT meaning FROM dictionary WHERE CONTAINS(word, keyword, '+"wordSearched"+')";But am unable to get the full text search result. Am i wrong in my syntax for querying full text search. or may be can anyone help it out giving the proper syntax to query word and keyword column. Thanks in Advance!
Aspiring Techie, Vishnu Nath
-
Hii, I have a table in a database called dictionary. I have four columns namely id, word , keyword and meaning. I have indexed word, keyword and meaning column in a catalog for full text searching of any word. I want full text searching of any word in these two column and return meaning of that word found in word and keyword column. I searched the table for the word using following query :
string wordSearched=textBox1.Text;
"SELECT meaning FROM dictionary WHERE CONTAINS(word, keyword, '+"wordSearched"+')";But am unable to get the full text search result. Am i wrong in my syntax for querying full text search. or may be can anyone help it out giving the proper syntax to query word and keyword column. Thanks in Advance!
Aspiring Techie, Vishnu Nath
Try This Replace Contains :( , with instr :) Use Instr function
Rajesh B --> A Poor Workman Blames His Tools <--
-
Hii, I have a table in a database called dictionary. I have four columns namely id, word , keyword and meaning. I have indexed word, keyword and meaning column in a catalog for full text searching of any word. I want full text searching of any word in these two column and return meaning of that word found in word and keyword column. I searched the table for the word using following query :
string wordSearched=textBox1.Text;
"SELECT meaning FROM dictionary WHERE CONTAINS(word, keyword, '+"wordSearched"+')";But am unable to get the full text search result. Am i wrong in my syntax for querying full text search. or may be can anyone help it out giving the proper syntax to query word and keyword column. Thanks in Advance!
Aspiring Techie, Vishnu Nath
Hello, You can use asterisk.
SELECT meaning FROM dictionary WHERE CONTAINS(*, '+"wordSearched"+')
or
SELECT meaning FROM dictionary WHERE CONTAINS(word, '+"wordSearched"+') or CONTAINS(keyword, '+"wordSearched"+')
or containstable sample
select id, f.[rank], [Name], [Description] from eshop_product inner join containstable(eshop_product,[Description], 'ISABOUT(bike weight(.9), pedals weight(.3) ) ' ) f on eshop_product.id = f.[KEY]
or use karsa full text search manager I hope this help you Michal