我已经完成了一些在线阅读,但似乎找不到我正在寻找的答案。可能是因为我以错误的方式接近这一点。 我正在使用Oracle 10g。
我的表xyz包含列:
recID- VARCHAR type
XML- CLOB type
XML列包含xml和html标记。即
<Employee><firstName>John</firstName>
<EmpDesc><![CDATA[<p>I like to live by Ghandi's motto: Be the <strong>change</strong> you want to see</p>]]</EmpDesc>
</Employee>
创建了一个索引:
create index myIndex on xyz(xml) indextype is ctxsys.context
当我执行下面的查询时,我没有得到我期望的结果,因为其中一个单词包含在html标记中。
SELECT * from xyz where contains(xml, 'be the change you want to see')>0;
*请注意,字符串可以存在于任何节点中,因此inpath可能不是合适的选项。
有没有办法创建一个索引来忽略html标签,以便返回结果?