Make an EMC xDB xQuery XML content search

时间:2017-08-04 12:38:32

标签: xml database xquery emc

I'm new to EMC xDB and I'm trying to understand how it works. I have read some of the documentation, but can't find the answer for my question.

What is the best method for an XML content search?

I can make a xQuery search/operation, but I can't figure out how I make an XML content search?

Let's assume I want to make a xQuery in dir "/test" and want to search if any XML files contains the number "102548458"

1 个答案:

答案 0 :(得分:0)

答案取决于您的意思" XML内容搜索" - 全文搜索的精确值比较? xDB支持两者。

对于精确值匹配("返回/test库中/foo/bar"元素等于102548458)的所有XML文档,您可以使用简单的XQuery如下:

for $x in doc('/test')
where $x/foo/bar = 102548458
return $x

要执行全文搜索("返回/test库中/foo/bar"包含文本102548458)的所有XML文档,您可以使用以下XQuery Full Text查询:

for $x in doc('/test')
where $x/foo/bar contains text '102548458'
return $x