1

eXist-db に保存されているコレクションに対して ft:query を実行していますが、結果が返されません。fn:contains 関数を使用すると完璧に動作しますが、ft:query はゼロの結果を返します。以下は、私の XML 構造、インデックス構成ファイル、およびクエリです。

test.xml

<article xmlns="http://www.rsc.org/schema/rscart38"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    type="ART" 
    xsi:schemaLocation="http://www.rsc.org/schema/rscart38 http://www.rsc.org/schema/rscart38/rscart38.xsd" dtd="RSCART3.8">
    <metainfo last-modified="2012-11-23T19:16:50.023Z">
        <subsyear>1997</subsyear>
        <collectiontype>rscart</collectiontype>
        <collectionname>journals</collectionname>
        <docid>A605867A</docid>
        <doctitle>NMR studies on hydrophobic interactions in solution Part
            2.—Temperature and urea effect on
            the self-association of ethanol in water</doctitle>
        <summary/>
</article>

コレクション.xconf

<collection xmlns="http://exist-db.org/collection-config/1.0">
    <index rsc="http://www.rsc.org/schema/rscart38"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        type="ART"
        xsi:schemaLocation="http://www.rsc.org/schema/rscart38 http://www.rsc.org/schema/rscart38/rscart38.xsd" 
        dtd="RSCART3.8">
        <fulltext default="all" attributes="false"/>
        <lucene>
            <analyzer id="nosw" class="org.apache.lucene.analysis.standard.StandardAnalyzer">
                <param name="stopwords" type="org.apache.lucene.analysis.util.CharArraySet"/>
            </analyzer>
            <text qname="//rsc:article" analyzer="nosw"/>
        </lucene>
        <create path="//rsc:doctitle" type="xs:string"/>
        <create path="//rsc:journal-full-title" type="xs:string"/>
        <create path="//rsc:journal-full-title" type="xs:string"/>
    </index>
</collection>

test.xq

declare namespace rsc="http://www.rsc.org/schema/rscart38";
let $coll := collection('/db/apps/test/RSC')
let $hits := $coll//rsc:doctitle[ft:query(., 'studies')] 
return 
    $hits
4

2 に答える 2

1

あなたが行った方法でストップワードなしで標準アナライザーを構成することが正しいかどうかはわかりません. あなたのインデックスにあなたの用語が含まれていることをマネックスに確認できますか?

また、インデックスをロードした後にインデックス構成を作成した場合は、コレクションのインデックスを再作成する必要があることに注意してください。$EXIST_HOME/webapp/WEB-INF/exist.logインデックスを再作成するときは、インデックス作成が期待どおりに行われることを確認するためにも監視する価値があります。

于 2017-01-10T14:31:42.517 に答える