- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 xquery 文件,它返回超过 2.2GB 的文本数据。当我直接在浏览器(Chrome)中点击 xquery 文件时,它会加载所有文本数据。
但是当我尝试使用 xdmp:http-post($url,$options)
对该 xquery 文件进行后期调用时它引发 XDMP-TOOBIG 错误。下面是踪迹。
XDMP-TOOBIG: xdmp:http-post("http://server:8278/services/getText...", <options xmlns="xdmp:http"><timeout>600000</timeout><authentication method="basic"><usernam...</options>) -- Document size exceeds text document size limit of 2048 megabytes
in /services/invoke.xqy, at 20:7 [1.0-ml]
$HTTP_CALL = <configurations xmlns:config="" xmlns=""><credentails><username>admin</username><password>admin</password...</configurations>
$userName = text{"admin"}
$password = text{"admin"}
$timeOut = text{"600000"}
$url = "http://server:8278/services/getText..."
$responseType = "text/plain"
$options = <options xmlns="xdmp:http"><timeout>600000</timeout><authentication method="basic"><usernam...</options>
$response = xdmp:http-post("http://server:8278/services/getText...", <options xmlns="xdmp:http"><timeout>600000</timeout><authentication method="basic"><usernam...</options>)
$set-reponse-type = ()
最佳答案
当使用 HTTP 从 MarkLogic 内部调用外部服务器时,结果必须适合内存,可能有多个副本,具体取决于您的操作。
文本变量未针对超大数据进行优化。根据远程服务的详细信息,您可以使用分页 HTTP 请求(使用 Range Request Headers )来容纳大数据
即使取消了 2G 限制,性能也会很差且不可靠:使用单个 HTTP 请求传输大量数据变得越来越不可靠,因为任何严重的网络错误都需要完全重试。
或者,可以增加服务或本地代理服务以将数据存储在共享位置,例如挂载的文件系统或 S3,并返回对数据的引用而不是其主体。然后可以使用 xdmp:filesystem-xxx 和 xdmp:binary-xxx 函数来访问数据。
一旦进入内存,将大文本数据作为单个字符串进行操作也会有问题。如果您需要访问单个大对象,则可以使用二进制文档(内部或外部)以获得更好的可靠性。
如果 HTTP 请求可以转换为使用 GET 而不是 POST,则可以使用 xdmp:document-load 将结果直接流式传输到文档中。
对 xdmp:document-load 文档的评论建议您可以使用“rest:”uri 前缀作为 POST 或 GET 将结果直接流式传输到数据库,尽管我不知道如何以这种方式传递 POST。
关于marklogic - 使用 xdmp :http-post 时发生 XDMP-TOOBIG 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36867412/
有人可以更好地解释 xdmp:eval() 和 xdmp:value() 函数吗? 我曾尝试遵循 Developer API。但是,我对这些实例并不是很满意,而且对我来说有点模糊。如果有人可以通过示例
我有一个 xquery 文件,它返回超过 2.2GB 的文本数据。当我直接在浏览器(Chrome)中点击 xquery 文件时,它会加载所有文本数据。 但是当我尝试使用 xdmp:http-post(
我使用这个表达式来加载 html 文档: xdmp:document-load("http://example.com/index.html", /documents/content.x
我正在尝试将变量传递到 MarkLogic 8.0.4 xdmp.eval() 中,如下所示: var spo = 'spo-role'; var spoRoleRes = xdmp.eval("va
我有一个我为生成序列号而编写的函数。功能如下: declare function generate-instrument-Id( $cnt as xs:int? ) as xs:int { l
我们正在使用 MarkLogic-8 (三个节点 - 每个节点有两个森林)并且一直面对 XDMP-NEWSTAMP 异常频繁。 我们有 default merge policy并且不要使用任何 poi
我正在使用 marklogic 4 并且我有大约 15000 个文档(每个大约 10 KB)。我想将整个内容作为文档加载(并将所有文档转换为单个 csv 文件并输出到 HTTP 输出流以供下载)。当我
如果我们调用一些 xquery模块第一次需要一些时间。后续调用更快可能是因为 xquery模块被解析并存在于模块缓存中。 考虑以下情况:- HTTP Server1- xdmp:invoke('/a/
您好,我想编写清晰的代码,我可以阅读并有一个很好的概述。 所以我写了这个: var id = '12345'; var coll = ['scc-roles','scc-proj-' + id]; v
marklogic 函数库中是否定义了任何方法,我们可以通过该方法将字符串( xs:string 类型)转换(或尝试转换)为 xml ' document ' 类型?在我的问题中,我通常会通过请求参数
我正在尝试使用 XQuery 和 Java 生成相同的 64 位整数。目前,我正在使用 XQuery (MarkLogic) 并使用 xdmp:hash64生成 64 位数字的函数。 例如,xdmp:
使用 HTML5 中的新文档类型和元素,您如何获得 xdmp:tidy()识别 HTML5 中的那些? 如果我有一个包含以下内容的 html 页面: blah blah 然后尝试类
我很难找到有关 xdmp:plan 输出内容的详细信息方法。 有一个像这样的简单查询: xdmp:plan(cts:search(doc(), cts:element-value-query(xs:Q
是否可以查看直接从查询控制台运行的 xdmp:log() 的输出,即 localhost:8000。 所以如果我有这样的代码: let $c := "hello world" return xdmp:
我有一个要求,我需要在所有过程完成后最后返回完整的文档。 我的最后一条语句有一个 xdmp:node-replace(),因此它返回一个 空序列。 节点在我的最终文档中被替换,但我无法在第一次运行时在
我正在尝试使用此函数从 MarkLogic 8 中的文本中删除停用词: declare function rec:remove-stop-words($string, $stop_words) {
我在运行一组查询时遇到了一个非常严重的问题。我收到以下错误:Time limit exceeded。我试图一次运行它们,然后它们返回了。虽然我已经更改了默认时间限制、最大时间限制、 session 超
我有一个场景,我想删除的大多数文档都在一个名为“过期”的集合中。我不想通过运行一个长时间运行的进程来使我的服务器重载,该进程将遍历文档并一个一个地删除它们,我宁愿使用文档删除以批量大小进行处理。 所以
我们已经尝试了锁定方法的所有选项,文档被锁定,但即使锁定尚未释放,另一个用户仍然可以更新文档。 xdmp:lock-acquire("/inventory/hassan", "exclusive",
我通过 fn:doc() 从数据库中获取记录和 quote和 unquote .但是,如果我尝试获取 base-uri,它会给出空结果. let $Doc := fn:doc("/aaaa.xml"
我是一名优秀的程序员,十分优秀!