boost可以应用于Lucene领域吗?

问题描述

鉴于我的 collection.xconf 中的 Lucene 索引配置

<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">
    <fulltext default="none" attributes="false"/>
    <lucene>
      <analyzer class="org.apache.lucene.analysis.en.EnglishAnalyzer" id="en"/>
      <analyzer class="org.apache.lucene.analysis.fr.frenchAnalyzer" id="fr"/>

      <text qname="tei:title" index="no">
        <field analyzer="en" name="en" if="ancestor-or-self::*/@xml:lang='en'" />
        <field analyzer="fr" name="fr" if="ancestor-or-self::*/@xml:lang='fr'" />
      </text>
      <text qname="tei:div" index="no">
        <field analyzer="en" name="en" if="ancestor-or-self::*/@xml:lang='en'" />
        <field analyzer="fr" name="fr" if="ancestor-or-self::*/@xml:lang='fr'" />
      </text>
    </lucene>
  </index>
</collection>

如何提高 tei:title 元素的点击率?

我试过了

      <text qname="tei:title" index="no" boost="2">
        <field analyzer="en" name="en" if="ancestor-or-self::*/@xml:lang='en'" />
        <field analyzer="fr" name="fr" if="ancestor-or-self::*/@xml:lang='fr'" />
      </text>

还有

      <text qname="tei:title" index="no">
        <field boost="2" analyzer="en" name="en" if="ancestor-or-self::*/@xml:lang='en'" />
        <field boost="2" analyzer="fr" name="fr" if="ancestor-or-self::*/@xml:lang='fr'" />
      </text>

但是,虽然前者由于仅对字段进行索引而被忽略,但后者甚至似乎都无效。

解决方法

事实证明这是不可能的,但将来可能会添加。

以下是跟踪进度的功能请求:https://github.com/eXist-db/exist/issues/3874

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...