変換結果を使用し、メタデータ スニペットを適用して、検索時にドキュメントのプロパティを抽出しています。プロパティを取得できません。また、を削除する<preferred-matches>
と、ドキュメントには prop-lastmodifed を返す必要があると記載されています。しかし、私は何も得ていません。以下は私がやっていることです
xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";
declare namespace prop = "http://marklogic.com/xdmp/property";
declare namespace meta = "http://ir.abbivenet.com/content-repo/metadata";
import module namespace search = "http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy";
let $q := "(TNF)"
let $options :=
<options xmlns="http://marklogic.com/appservices/search">
<term>
<term-option>case-insensitive</term-option>
<term-option>punctuation-insensitive</term-option>
<term-option>whitespace-insensitive</term-option>
<term-option>wildcarded</term-option>
</term>
<transform-results apply="metadata-snippet">
<preferred-matches>
<element ns="http://ir.abbivenet.com/content-repo/metadata" name="id"/>
</preferred-matches>
</transform-results>
<!--
<return-facets>false</return-facets>
<return-values>false</return-values>
<return-constraints>false</return-constraints>
<return-frequencies>false</return-frequencies>
<return-qtext>false</return-qtext>
<search-option>unfaceted</search-option>
<search-option>score-simple</search-option>
-->
</options>
let $start := 1
let $page-length :=1000000
let $query-original := cts:query(search:parse($q, $options))
let $result := search:resolve(document { $query-original }/*,
$options,
$start,
$page-length)
return $result
以下は私の結果のスニペットです
<search:response snippet-format="metadata-snippet" total="546" start="1" page-length="1000000" xmlns:search="http://marklogic.com/appservices/search">
<search:result index="1"
uri="/documents/BioEln/79ca10522ef2bd3da946623c8dd1f5c6c786d983.xml/extractedText/79ca10522ef2bd3da946623c8dd1f5c6c786d983.xhtml"
path="fn:doc("/documents/BioEln/79ca10522ef2bd3da946623c8dd1f5c6c786d983.xml/extractedText/79ca10522ef2bd3da946623c8dd1f5c6c786d983.xhtml")"
score="246272" confidence="0.7858079" fitness="1">
<search:snippet>
<search:match
path="fn:doc("/documents/BioEln/79ca10522ef2bd3da946623c8dd1f5c6c786d983.xml/extractedText/79ca10522ef2bd3da946623c8dd1f5c6c786d983.xhtml")">
</search:match>
</search:snippet>
</search:result>
<search:result index="2"
uri="/documents/BioEln/568819dbbf44a75598739e8272d0de5956dadff4.xml/extractedText/568819dbbf44a75598739e8272d0de5956dadff4.xhtml"
path="fn:doc("/documents/BioEln/568819dbbf44a75598739e8272d0de5956dadff4.xml/extractedText/568819dbbf44a75598739e8272d0de5956dadff4.xhtml")"
score="246272" confidence="0.7858079" fitness="1">
<search:snippet>
<search:match path="fn:doc("/documents/BioEln/568819dbbf44a75598739e8272d0de5956dadff4.xml/extractedText/568819dbbf44a75598739e8272d0de5956dadff4.xhtml")">
</search:match>
</search:snippet>
</search:result>
<search:result index="3" uri="