使用属于HTML5的新doctype和元素,您如何xdmp:tidy()识别HTML5中的那些?
如果我有一个包含以下内容的html页面:
<!DOCTYPE html>
<html>
<header>blah</header>
<section>blah</section>
Run Code Online (Sandbox Code Playgroud)
然后尝试类似的东西:
xdmp:tidy(xdmp:document-get("home.html"))
我得到的错误如下:
<section> is not recognized! discarding unexpected <section>
<header> is not recognized! discarding unexpected <header>
Run Code Online (Sandbox Code Playgroud)
我可以发送一些选项xdmp:tidy()让它来处理它吗?
我们已经启动了一个使用marklogic存储文档的新项目.为了让应用程序运行,我们需要创建一个数据库,一个林,新用户并设置一个XDBC服务器.通过Marklogic提供的Web管理工具很容易实现,但是要从持续集成服务器运行它,我们需要自动化它.有没有办法从命令行执行此操作(如sqlserver的sqlcmd.exe或oracle中的sql plus)?
我想在xquery中使用Group By.有人能告诉我如何在Marklogic中使用Group By吗?
我想搜索文档的文档属性.我只有Marklogic中加载的文档,没有xml文件.我已经关闭了内容处理.现在我想搜索元数据(存在xdmp:document-properties(uri))
我在文档中有以下属性: -
<?xml version="1.0" encoding="UTF-8"?>
<prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
<uploaded>true</uploaded>
<OntologyResourceTypeValue>DOCUMENT</OntologyResourceTypeValue>
<content-type>application/pdf</content-type>
<filter-capabilities>text subfiles HD-HTML</filter-capabilities>
<CreationDate>2002/12/05 09:44:29Z</CreationDate>
<ModDate>2002/12/05 12:02:27+02'00'</ModDate>
<Producer>Acrobat Distiller 5.0 (Windows)</Producer>
<Author>Administrator</Author>
<Creator>PScript5.dll Version 5.2</Creator>
</prop:properties>
Run Code Online (Sandbox Code Playgroud)
现在我想搜索作者而不是其他属性.如果我正在使用search:search("Administrator")那么它正在整个文档中寻找这个词.但是,我想只搜索文档属性中的Author标记.同样,我也希望在其他属性中搜索.
我也试过这个: -
let $options := <options xmlns="http://marklogic.com/appservices/search">
<constraint name="author">
<properties name="prop:Author"/>
</constraint>
</options>
let $results := search:search("author:Administrator", $options, 1, 10)
return
$results
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用.请帮忙.
我正在尝试搜索特定元素,因此我在我的选项中有一个可搜索表达式.我还想按这个元素的值排序,所以我在value元素上创建了一个元素范围索引.以下是我的搜索选项,希望能让事情变得清晰:
<options xmlns="http://marklogic.com/appservices/search">
<term>
<term-option>case-insensitive</term-option>
</term>
<debug>true</debug>
<searchable-expression>/summary/name/value</searchable-expression>
<sort-order type="xs:string" direction="ascending">
<element ns="" name="value"/>
<annotation>options for search institutions by name</annotation>
</sort-order>
</options>
Run Code Online (Sandbox Code Playgroud)
问题是当它进行排序时它会添加另一个值节点(取自搜索:report id ="SEARCH-FLWOR")
...order by xs:string(($result//value)[1]) ascending return $result)[1 to 50]
Run Code Online (Sandbox Code Playgroud)
代替:
...order by xs:string(($result)[1]) ascending return $result)[1 to 50]
Run Code Online (Sandbox Code Playgroud)
我如何阻止它这样做?我无法更改可搜索的表达式,因为"name"元素具有另一个我不想搜索的子元素.我也不能将sort-order元素名称留空或将其设置为当前节点.看起来这很简单,但我还没有找到任何工作.
非常感谢帮助.
在MarkLogic中,是否可以将cts:search表达式绑定到变量,然后在XQuery中的其他位置使用该变量?
我想做这样的事情:
let $query := cts:search(doc(),
cts:and-query((
cts:element-attribute-word-query(
xs:QName("para"),
xs:QName("role"),
"intro") ,
cts:element-attribute-word-query(
xs:QName("title"),
xs:QName("role"),
"inline")
))
)
let $number-of-results := xdmp:estimate($query)
return $number of results
Run Code Online (Sandbox Code Playgroud)
但是,我不确定如何传递表达本身,而不是它返回的内容.
我有以下挑战.我们有想要使用mlcp加载到MarkLogic数据库的csv文件.我们还希望在加载期间将加载的行转换为OBI源,因此我们为此构建了转换函数.
现在我正在努力改造.如果没有转换,数据将按预期加载为每行doc.
csv示例:
voornaam,achternaam
hugo,koopmans
thijs,van ulden
Run Code Online (Sandbox Code Playgroud)
变换ambulance.xqy:
xquery version "1.0-ml";
module namespace rws = "http://marklogic.com/rws";
import module namespace source = "http://marklogic.com/solutions/obi/source" at "/ext/obi/lib/source-lib.xqy";
(: If the input document is XML, create an OBI source from it, with the value
: specified in the input parameter. If the input document is not
: XML, leave it as-is.
:)
declare function rws:transform(
$content as map:map,
$context as map:map
) as map:map*
{
let $attr-value :=
(map:get($context, "transform_param"), "UNDEFINED")[1]
let $the-doc := …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Native JSON属性上添加范围索引,该属性在MarkLogic Server中的名称中包含冒号(:).
样本数据如下.
{
"Aspects": {
"xbrl28:TransactionTime": "2014-08-13T00:00:00+0000",
"xbrl28:Archive": "S1002U7K",
"xbrl:Period": "2014-08-13"
},
"_id": "27948e6d-a774-49ee-8e30-668cc4731975"
}
Run Code Online (Sandbox Code Playgroud)
当我尝试在"xbrl28:Archive"上添加范围索引时,但我不能,因为"xbrl28:"被视为命名空间的前缀.有没有办法逃脱结肠?
我想在marklogic中使用rest api搜索基于其中一个属性的文档.这是文件 -
{
"id" : "101",
"sectionName" : "PI"
"firstName" : "I",
"middle name" : "Me",
"last name : "Myself",
"emailId" : "aaa@gmail.com"
}
Run Code Online (Sandbox Code Playgroud)
可以说,我想基于sectionName搜索文档,然后按ID排序,那么我的其余查询是什么?
我有一个场景,我想要删除的大多数文件都在一个名为"过期"的集合中.我不希望通过运行一个长时间运行的进程来重载我的服务器,这个进程将遍历文档并逐个删除它们,我宁愿使用document-delete以批量大小来执行它们.
所以我的问题是xdmp:collection-delete是如何工作的?
它是否迭代文档并删除它们?
要么
它是否像SQL中的DROP Table和它的"瞬时"一样?
我想知道xdmp:collection-delete的后台进程是什么.我想知道是否有人可以绘制该函数如何处理文档以进行删除的流程,因为我想要更深入地理解该过程,而不仅仅是概述它的作用.
marklogic ×10
xquery ×4
marklogic-8 ×2
cts-search ×1
group-by ×1
json ×1
marklogic-7 ×1
mlcp ×1
nosql ×1
tidy ×1