1

我做了一些在线阅读,但似乎无法找到我正在寻找的答案。这可能是因为我以错误的方式处理这个问题。我正在使用 Oracle 10g。

我有带有列的表 xyz:

recID-   VARCHAR type

XML- CLOB type

XML 列包含 xml 和 html 标记。IE。

<Employee><firstName>John</firstName>
<EmpDesc><![CDATA[<p>I like to live by Ghandi&#39s 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 标签以便返回结果?

4

0 回答 0