2017-03-17 23 views
3

我發現cts:element-word-query未能在搜索字詞中包含兩個以上單詞(包括所有格的「s」)時選擇任何項目。我們當前7.0-4.3生產服務器上,而不是在我們的開發服務器上運行7.0-5.4MarkLogic元素字查詢在> 2個字詞上失敗

pkg:database-configuration()結果相比沒有顯示出任何明確的理由,爲什麼這將是發生

下面的XQuery:。

for $x in ((//ch_firstSource)[1 to 10]) 
let $q := cts:element-word-query(xs:QName('ch_firstSource'), (string($x))) 
return (
    $x, 
    xdmp:estimate(cts:search(collection(),$q)), 
    cts:highlight($x, $q, element hit {$cts:text}) 
) 

產生在生產以下結果:

<ch_firstSource>Authentic Copy New Constit. France</ch_firstSource> 
0 
<ch_firstSource><hit>Authentic Copy New Constit. France</hit></ch_firstSource> 
<ch_firstSource>Facsimiles National MSS Scotl.</ch_firstSource> 
0 
<ch_firstSource><hit>Facsimiles National MSS Scotl.</hit></ch_firstSource> 
<ch_firstSource>Geoffrey Chaucer</ch_firstSource> 
50900 
<ch_firstSource><hit>Geoffrey Chaucer</hit></ch_firstSource> 
<ch_firstSource>Thomas Newton</ch_firstSource> 
1771 
<ch_firstSource><hit>Thomas Newton</hit></ch_firstSource> 
<ch_firstSource>Apocalypse St. John: A Version</ch_firstSource> 
0 
<ch_firstSource><hit>Apocalypse St. John: A Version</hit></ch_firstSource> 
<ch_firstSource>Apocalypse St. John: A Version</ch_firstSource> 
0 
<ch_firstSource><hit>Apocalypse St. John: A Version</hit></ch_firstSource> 
<ch_firstSource>Stephen Hawes</ch_firstSource> 
2117 
<ch_firstSource><hit>Stephen Hawes</hit></ch_firstSource> 
<ch_firstSource>Stephen Hawes</ch_firstSource> 
2117 
<ch_firstSource><hit>Stephen Hawes</hit></ch_firstSource> 
<ch_firstSource>Bede's Ecclesiastical History</ch_firstSource> 
0 
<ch_firstSource><hit>Bede's Ecclesiastical History</hit></ch_firstSource> 
<ch_firstSource>Pseudo-Apuleius' Herbarium</ch_firstSource> 
0 
<ch_firstSource><hit>Pseudo-Apuleius' Herbarium</hit></ch_firstSource> 

較大的組包括:

<ch_firstSource>R. Whitford</ch_firstSource> 
411 
<ch_firstSource><hit>R. Whitford</hit></ch_firstSource> 

在dev的,相同的查詢產生:

<ch_firstSource>Thomas Newton</ch_firstSource> 
497 
<ch_firstSource> 
<hit>Thomas Newton</hit> 
</ch_firstSource> 
<ch_firstSource>Stephen Marshall</ch_firstSource> 
88 
<ch_firstSource> 
<hit>Stephen Marshall</hit> 
</ch_firstSource> 
<ch_firstSource>Secreta Secretorum</ch_firstSource> 
425 
<ch_firstSource> 
<hit>Secreta Secretorum</hit> 
</ch_firstSource> 
<ch_firstSource>New Scientist</ch_firstSource> 
421 
<ch_firstSource> 
<hit>New Scientist</hit> 
</ch_firstSource> 
<ch_firstSource>Quarterly Review</ch_firstSource> 
1226 
<ch_firstSource> 
<hit>Quarterly Review</hit> 
</ch_firstSource> 
<ch_firstSource>Thomas Davis</ch_firstSource> 
50 
<ch_firstSource> 
<hit>Thomas Davis</hit> 
</ch_firstSource> 
<ch_firstSource>Arthur Young</ch_firstSource> 
473 
<ch_firstSource> 
<hit>Arthur Young</hit> 
</ch_firstSource> 
<ch_firstSource>William Durrant Cooper</ch_firstSource> 
14 
<ch_firstSource> 
<hit>William Durrant Cooper</hit> 
</ch_firstSource> 
<ch_firstSource>Westminster Gazette</ch_firstSource> 
2629 
<ch_firstSource> 
<hit>Westminster Gazette</hit> 
</ch_firstSource> 
<ch_firstSource>Deb. Congress 1808</ch_firstSource> 
1 
<ch_firstSource> 
<hit>Deb. Congress 1808</hit> 
</ch_firstSource> 

有沒有人有任何想法爲什麼這可能會發生?

+0

有點棘手查明原因不知道確切的數據庫配置。再次,SO可能不是這種深入調查的最佳渠道。 – grtjn

+0

雖然在7.0-4.3和7.0-5.4之間的單詞查詢領域出現了一些錯誤修正,所以也許它只是一個修復的錯誤。 – grtjn

+0

這很有用。謝謝。 –

回答

0

要查看版本7.0-4.3和7.0-5.4之間已發佈的錯誤修復,請轉至https://help.marklogic.com/Bugtrack/List並在From和To字段中輸入這些版本,然後單擊Show。我沒有看到任何與您的案例相符的內容,但值得一看。

我有一個理論,直到「大集合」的數據 - 在你最初的例子中,所有大於兩個單詞的例子都有標點符號。 (您更大的結果集似乎是一個相反的例子。)以防萬一,你能運行

for $x in ((//ch_firstSource)[1 to 10]) 
let $q := cts:element-word-query(xs:QName('ch_firstSource'), (string($x))) 
return (
    $x, 
    xdmp:estimate(cts:search(collection(), $q, "punctuation-insensitive")), 
    cts:highlight($x, $q, element hit {$cts:text}) 
) 
+0

正確,將「標點符號不敏感」添加到查詢(:不是搜索:)不能解決問題。我會看看這些錯誤。 –