I am trying to do a search on our web site using the microsoft indexing service and I am getting a syntax error with the following query.
cmdSearch.CommandText = "select doctitle, filename, path, rank, characterization from scope() where CONTAINS('" + searchText + "') order by rank desc ";
The only time there is an issue is when I have two words in the searchText variable. So 'test' would work fine but 'test two' gets this error
Search Error: Incorrect syntax near 'two'. Expected end-of-file, ',', '.', ';', '<', '=', '>', AS, ASC, DESC, IS, IS_NOT, LIKE, NOT_LIKE, GE, LE, NE. SQLSTATE=42000
↧