现保存一篇文章在库中 标题用varchar2 (oracle) 内容是clob 
  如要搜索关键词: 你好    我现在实现办法是: 
  DBMS_LOB.INSTR(t.CONTENT, '你好', 1, 1) > 0 or t.title like '%你好%' 
  这样是能搜索出来 
  现有一问题是在库中保存的内容有一部分是页面标签来的  
  如在库中clob有这样的数据: <LI> <A href="http://msn.ynet.com/view.jsp?oid=43056433"> 这些样式标签链接等,但这些内容是在页面没有显示出来的,如搜索关键词:.com 搜出来的内容就客户所要求不一致了 
  现请教各路高人 这种情况如何解决

解决方案 »

  1.   

    可以处理一下只搜出双引号里面的内容。
    http://msn.ynet.com/view.jsp?oid=43056433
      

  2.   

    .com 还算关键字?  要客户搜ynet.  别理他. 呵呵
      

  3.   

    在数据库中你存储的数据是: <LI> <A href="http://msn.ynet.com/view.jsp?oid=43056433">而这样在页面上显示会有<LI> <A href>等标签出来对吧?你现在不想让它出来,在数据库层可以用SQL只搜索出下面链接的地址数据:
    http://msn.ynet.com/view.jsp?oid=43056433而不是出来<LI> <A href="http://msn.ynet.com/view.jsp?oid=43056433">
      

  4.   

    不是这个意思
    我现在搜索的内容 出现在标签中不算
     如关键词:  com     
     clob字段内容有       <LI> <A href="http://msn.ynet.com/view.jsp?oid=43056433"></A>
     这段内容虽然出现了com这个关键词 但这个关键词在页面是看不到的,它只是个标签链接,所以不能算在那里面
      

  5.   

    所以只要用SQL搜索出链接地址的数据http://msn.ynet.com/view.jsp?oid=43056433就好了。你觉得呢?
    SQL> SELECT SUBSTR(STR,
      2                INSTR(STR, '"', 1, 1) + 1,
      3                INSTR(STR, '"', 1, 2) - INSTR(STR, '"', 1, 1) - 1) NEW_STR
      4    FROM (SELECT '<LI> <A href="http://msn.ynet.com/view.jsp?oid=43056433"> </A>' STR
      5            FROM DUAL);NEW_STR
    -----------------------------------------
    http://msn.ynet.com/view.jsp?oid=43056433Executed in 0.922 seconds
      

  6.   

    I think not only link, there are many hidden contents in HTML, all of the contents like that should not be searched out.
    It is hard to do that, because just HTML engine can parse all of the tag.What you can do now is limit content format.