在 eXist-db 4.4 中,我试图实现一个基本的 Lucene 查询结构,但它没有返回任何结果。
在/db/apps/deheresi/data
我有一组tei-xml
具有相同结构的文档,我只想将我的查询应用于元素tei:seg
及其后代中找到的文本内容。一个典型的样本是:
<TEI>
<text>
[...]
<seg type="dep_event" subtype="event" xml:id="MS609-0001-1">
<pb n="1r"/>
<lb break="n" n="1"/>
<date type="deposition_date" when="1245-05-27" cert="high">Anno
Domini M° CC° XL° quinto VI Kalendas Iunii.</date>
<persName nymRef="#Arnald_Garnier_MSP-AU" role="dep">Arnaldus Garnerii</persName>
testis iuratus dixit quod vidit in
<placeName type="event_loc" nymRef="#home_of_Cap-de-Porc">domo
<persName nymRef="#Peire_Cap-de-Porc_MSP-AU" role="own">Petri de Sancto Andrea</persName>
</placeName>
<lb break="y" n="2"/>
<persName nymRef="#Bernard_Cap-de-Porc_MSP-AU" role="her">B<supplied reason="expname">ernardum</supplied> de Sancto Andrea</persName>,
fratrem dicti Petri, et socium eius, hereticos. Et vidit ibi cum eis dictum
<persName nymRef="#Peire_Cap-de-Porc_MSP-AU" ana="#uAdo" role="par">P<supplied reason="expname">etrum</supplied> de Sancto Andrea</persName> et
<persName nymRef="#Susanna_Cap-de-Porc_MSP-AU" ana="#uAdo" role="par">uxor dicti<lb break="y" n="3"/>Petri</persName>. Et
<persName nymRef="#Arnald_Garnier_MSP-AU" ana="#pAdo" role="par"/>ipse
testis adoravit ibi dictos hereticos, sed non vidit alios adorare. Et
<date type="event_date" when="1239">sunt VI anni vel circa</date>.
<seg type="inq_int" subtype="specific_question">Et quando ipse testis exivit<lb break="y" n="4"/>domum invenit
<persName nymRef="#Guilhem_de_Rosengue_MSP-AU" key="inqint" ana="#pIntra" role="ref">Willelmus de Rozergue</persName> intrantem ad dictos hereticos.</seg>
</seg>
<seg>
[...]
</seg>
[...]
<text>
<TEI>
我创建并应用了如下的 Lucene 索引(包括ignore
某些元素):
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<lucene>
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
<text qname="tei:seg"/>
<ignore qname="tei:note"/>
<ignore qname="tei:gap"/>
<ignore qname="tei:del"/>
<ignore qname="tei:orig"/>
<inline qname="tei:supplied"/>
</lucene>
</index>
现在,我针对集合中的每个文档中多次找到的单个拉丁词运行查询:
let $query :=
<query>
<term>vidit</term>
</query>
return
collection('/db/apps/deheresi/data')//tei:seg[ft:query(.,$query)]
我收到了回复:
`eXist-db localhost 8081 : Your query returned an empty sequence`
我是否忽略了 Lucene 实现难题的一部分?
提前谢谢了。