怎么通过多关键词模糊匹配搜索出含任意关键词的文章?

解决方案 »

  1.   

    1、取出多关键字字符串
    2、split换成 Stirng[]
    3、for循环,拼装参数 txtFiteror txt like '%关键字1%' 
    or txt like '%关键字2%' 
    or txt like '%关键字3%'
    ....4、sqlWhere = "where ( 1=1"+ txtFiter+" )"
      

  2.   


    if(str.indexof("星星")!=-1 || str.indexof("月亮")!=-1)
    {.....
    }
      

  3.   


    select * from 表名 where 字段名 like '%关键字%'
      

  4.   

    你所指的文章 是指本地文件 还是网页不过都离不开搜索引擎  简单的查找文件内的内容 可以看看lucene