我刚刚开始全文搜索,过去我总是使用通配符。这是我的查询:
SELECT rID, claimID+counter FROM claims WHERE claimID+counter LIKE '%ba%' AND (status='submitted' OR status='closed')
我试图将其转换为包含,但我收到一条错误消息,表示该列不存在。
SELECT rID, claimID+counter FROM claims WHERE contains(claimID+counter,'ba') AND (status='submitted' OR status='closed')
我尝试了以上但没有去。我该如何解决这个问题?
答案 0 :(得分:0)
试试这个
SELECT rID, claimID+counter FROM claims WHERE contains((claimID,counter),'ba') AND (status='submitted' OR status='closed')
如果您在
之类的脚本上运行错误Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'claims' because it is not full-text indexed.
然后确保您拥有full-text search feature installed
。
请按照此Link了解更多详情