SqlServer2005 全文索引 Contains两次同一字段,结果就无
例如:select * from A where contains ( (name,subject,body),'三国 or 红楼')
and contains ((subject),'西游')
以上查询即不显示任何结果。。那怕是有一条数据里面即有西游和三国和红楼,都不显示。。晕啊。。求救。。

解决方案 »

  1.   

    select * from A where contains ( (name,subject,body),'三国 or 红楼') select * from A where contains ((subject),'西游') 这样呢
      

  2.   


    我要的效果是and 为什么要用or?即两种交集
      

  3.   

    Try:
    select * from A where contains ( (name,subject,body),'"三国" or "红楼"') 
    and contains ((subject),'"西游"') 
      

  4.   

    很正常,sql中文分词做得很垃圾,
    相当一部分记录都会查不出来。
    查英文的一般比较精确一点。用like才能保证结果的精确性。
    如果一定要用全文检索并提高精确性,
    自己研究一下分词系统或使用第三方工具。
      

  5.   

    整了个折中的办法,但不是最理想的。。select * from A where contains ( (name,subject,body),'(三国 or 红楼) and (西游)') 
      

  6.   


    我一个用contains一个用like还是不能出效果,不过没有测试两个都用like
      

  7.   

    试试2个like吧。中文的contains 似乎辨别的不是很好
      

  8.   


    再顶一下,其实我搜索的就是英文的,上面的只是一个EXP
      

  9.   

    算了,上面的将就吧,,听说SQL版比较热,麻烦你们了。再问一下。。select * from A where contains((subject,body),('红楼 and 西游'))//仅是举例。查询结果好像不显示subject里面有红楼但没有西游,并且body列里有西游,没有红楼的 数据? 即单列必须两个同时满足的才显示?
      

  10.   

    Try:select * from A where contains ( (name,subject,body),'"三国*" or "红楼*"') 
    and contains ((subject),'"西游*"')