MarkLogic:了解可搜索和不可搜索的查询吗? [英] MarkLogic: Understanding searchable and unsearchable queries?
问题描述
我有以下表达式:
let $q1 := cts:element-range-query(xs:QName("ts:week"), ">=" ,xs:date("2009-04-25"))
return cts:search(fn:doc(), $q1, "unfiltered")
我做了一个xdmp:plan
,并且知道正在使用范围索引并且该表达式是可搜索的
I did a xdmp:plan
, and got to know that range indexes are being used and the expression is searchable
但是,当我添加XPath时:
However, when I added a XPath:
let $q1 := cts:element-range-query(xs:QName("ts:week"), ">=" ,xs:date("2009-04-25"))
return cts:search(fn:doc(), $q1, "unfiltered")/ts:top-song/ts:title/text()
执行xdmp:plan
时,它告诉我该路径不可搜索.在进行查询跟踪时,它说除了fn:doc()
之外没有其他可搜索的内容.
On doing a xdmp:plan
, it told me the path is unsearchable. Further on doing in query-trace it said other than fn:doc()
nothing searchable.
但是,由于我得到了正确的结果.我的猜测是索引工作正常.
However, since I am getting the correct result. My guess is that indexes are working just fine.
如果是,则记录"unsearchable"消息的原因是什么?
If so, what is logging the message "unsearchable" ?
在这种情况下,我特别需要title元素,我可以做些什么使整个表达式可搜索吗?
I specifically need the title element in this case, is there anything I can do to make the entire expression searchable ?
推荐答案
这段代码在做两件事:
- 执行搜索以获取文档序列
- 将XPath应用于文档序列以从文档中提取节点
换句话说,XPath不是搜索的一部分.它将后处理应用于搜索结果.
To put it another way, the XPath is not part of the search. It applies post-processing to the results of the search.
xdmp:estimate()
和xdmp:plan()
都仅接受搜索的输入,而不接受搜索结果的后处理.
Both xdmp:estimate()
and xdmp:plan()
accept only the input to the search and not the post-processing on the results of the search.
希望可以澄清
这篇关于MarkLogic:了解可搜索和不可搜索的查询吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!