我通過MLCP命令在我的數據庫中插入了200000個xml文檔(大約總大小爲1GB)。現在我想在該數據庫的搜索查詢下運行(數據庫,在admin api中使用默認索引設置)以獲取所有文檔。marklogic 8在我的數據庫中插入大量xml文件後,查詢性能下降
let $options :=
<options xmlns="http://marklogic.com/appservices/search">
<search-option>unfiltered</search-option>
<term>
<term-option>case-insensitive</term-option>
</term>
<constraint name="Title">
<range collation="http://marklogic.com/collation/" facet="true">
<element ns="http://learning.com" name="title" />
</range>
</constraint>
<constraint name="Keywords">
<range collation="http://marklogic.com/collation/" facet="true">
<element ns="http://learning.com" name="subjectKeyword" />
</range>
</constraint>
<constraint name="Subjects">
<range collation="http://marklogic.com/collation/" facet="true">
<element ns="http://learning.com" name="subjectHeading" />
</range>
</constraint>
<return-results>true</return-results>
<return-query>true</return-query>
</options>
let $result := search:search("**", $options, 1, 20)
return $result
範圍指數: -
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://learning.com</namespace-uri>
<localname>title</localname>
<collation>http://marklogic.com/collation/</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>ignore</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://learning.com</namespace-uri>
<localname>subjectKeyword</localname>
<collation>http://marklogic.com/collation/</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>ignore</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://learning.com</namespace-uri>
<localname>subjectHeading</localname>
<collation>http://marklogic.com/collation/</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>ignore</invalid-values>
</range-element-index>
在每個XML文檔subjectkeyword和標題值就像是
<lmm:subjectKeyword>anatomy, biology, illustration, cross, section, digestive, human, circulatory, body, small, neck, head, ear, torso, veins, teaching, model, deep, descending, heart, brain, muscles, lungs, diaphragm, c</lmm:subjectKeyword><lmm:title>CORTY_EQ07-014.eps</lmm:title>
但它拍了很多時間,甚至查詢控制檯說太多元素渲染或解析器錯誤:無法解析結果。文件大小太大
謝謝@rjrudin重播,我打算按照你的建議過程,像subjectKeyword元素到許多元素中,每個元素都有一個關鍵字 – Raj
但是對於標題,它並不是在你的200k文檔中唯一。它包含具有「_」,「 - 」,「。」等字符的值。在每個文件中。這些字符降低了我的處理時間。那我怎麼處理它? – Raj
爲什麼你想在標題方面? – rjrudin