简体   繁体   English

Marklogic:如何知道xquery返回的记录数?

[英]Marklogic: How to know the number of records returned by an xquery?

I'm performing an xquery over a set of xml documents. 我正在对一组xml文档执行xquery。 Then I'm reading it from another workspace using a web service. 然后,我正在使用Web服务从另一个工作区中读取它。 The result that I'm getting is half of the number of records stored in Marklogic. 我得到的结果是Marklogic中存储的记录数量的一半。 I have 764 xml records and I'm getting the results of 382 records. 我有764条xml记录,并且得到382条记录的结果。 I want to make sure that Marklogic is not skipping any record by knowing the number of the number of records returned by an xquery? 我想通过知道xquery返回的记录数来确保Marklogic不会跳过任何记录? And If it is possible I want to know if I can force Marklogi to perform the xquery on all of the records in my database. 并且,如果有可能,我想知道是否可以强制Marklogi对数据库中的所有记录执行xquery。

Are you certain your QueryConsole workspace is pointing to the correct database? 您确定您的QueryConsole工作区指向正确的数据库吗?

The closest thing to "force MarkLogic to perform the XQuery on all of the records in the database" would be to execute fn:count(fn:doc()) 与“强制MarkLogic对数据库中的所有记录执行XQuery”最接近的事情是执行fn:count(fn:doc())

What is the count from that? 这算什么呢? If you get back 764 then the discrepancy is likely because not all 764 records match your query. 如果返回764,则可能存在差异,因为并非所有764记录都与您的查询匹配。 We'd need to have more information about your specific query (and the structure of your data) in order to help troubleshoot with specificity. 我们需要有关您的特定查询(以及数据的结构)的更多信息,以帮助进行特定性故障排除。

Permissions might also be something to consider- make sure that your webservice is running as a user that has at least read privileges on all of the documents in the database. 权限也可能是要考虑的-确保您的Web服务以对数据库中所有文档至少具有读取特权的用户身份运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM