范围索引未应用于 eXist-DB 中的字段(未显示在 Monex 中)

Range Index not applied to field in eXist-DB (not shown in Monex)

提问人:B Polit 提问时间:11/10/2023 更新时间:11/10/2023 访问量:48

问:

我不确定,这是一个错误,还是我做错了什么(或者我是否有错误的假设)。

我有一个包含一个文档的集合:

<test bar="baz">foo</test>

还有一个:collection.xconf

<collection xmlns="http://exist-db.org/collection-config/1.0">
  <index xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <range>
      <create qname="test">
        <field name="bar-attr" match="@bar" type="xs:string"/>
        </create>
    </range>
  </index>
</collection>

现在我假设,当在 Monex 中查看时,索引 for(在集合的索引中)列出了 (此处) 的值。如果我将配置切换为:bar-attr@barbaz

<collection xmlns="http://exist-db.org/collection-config/1.0">
  <index xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <range>
      <create qname="@bar"/>
    </range>
  </index>
</collection>

baz正如预期的那样,是索引的一部分。

现在我的问题:

  1. 字段值是否未在 monex 的索引视图中列出?
  2. 还是我对这些领域的理解完全错误?

注意:我在基于 Apple Silicon 的 Mac 上的 Docker-Container 中使用 eXist-db 6.2.0。但是这个问题似乎也存在于其他平台上的 Docker 外部运行的实例中(我可以在 Linux VM 中重现它)。

xquery exist-db

评论

0赞 jbrehr 11/10/2023
这些是范围索引字段,我认为它们已被弃用,或者至少被使用全文 Lucene 索引创建的字段和分面所取代 - 它们都出现在 Monex 中。exist-db.org/exist/apps/doc/lucene#facets-and-fields
0赞 B Polit 11/10/2023
你是对的,有一个旧的范围索引。但我使用的是新的。我不想执行全文搜索——据我所知,这就是 lucene 索引的用途——但想将索引用于简单的查询。
1赞 B Polit 11/11/2023
好的,我在 GitHub 中发现了相应的问题: 1. github.com/eXist-db/monex/issues/191 2.github.com/eXist-db/exist/issues/4074所以一切都很好——这只是 Monex 中的一个错误。您仍然可以使用以下命令查看索引range:index-keys-for-field
0赞 Joe Wicentowski 11/12/2023
很高兴您发现了 Ash 的问题和解决方法。希望我们能弄清楚它的根源。

答: 暂无答案