gpt4 book ai didi

java - Solr复制字段复制到另一个字段

转载 作者:行者123 更新时间:2023-12-01 19:50:00 25 4
gpt4 key购买 nike


我有以下配置:

...

<field name="spellcheck" type="text_spell" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_de" type="text_spell_de" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_en" type="text_spell_en" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_fr" type="text_spell_fr" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_ja" type="text_spell" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_zh" type="text_spell" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_pt" type="text_spell_pt" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_it" type="text_spell_it" indexed="true" stored="true" multiValued="true" />
<field name="spellcheck_low" type="text_spell" indexed="true" stored="true" multiValued="true" />
<field name="spellchecksearch" type="text_spell_en" indexed="true" stored="false" multiValued="true" />

<copyField source="spellcheck_en" dest="spellcheck_low" />
<copyField source="spellcheck_low" dest="spellchecksearch" />
...

spellcheck_en 字段已填充,并且已正确复制到 spellcheck_low 字段中,并且已正确建立索引(使用 luke 索引查看器,我看到该字段的索引不为空)。但是,spellcheck_low 的副本似乎不起作用,因为 spellchecksearch 为空。注意:spellcheck_enspellcheck_low 字段均已建立索引并存储,而 spellchecksearch 不存储而仅建立索引。

为什么会发生这种情况?您可以阐明现场副本的工作原理,非常感谢:)

最佳答案

copyField 指令不会作为图表进行计算 - 最初为 source 字段提交的值也用于填充以 形式给出的字段目标

由于没有为 spellcheck_low 字段提交任何值,因此 copyField 指令最终会复制一个空值(..或根本不执行)。

就您而言,spellcheck_en 字段必须有两个目标:

<copyField source="spellcheck_en" dest="spellcheck_low" />
<copyField source="spellcheck_en" dest="spellchecksearch" />

这将与您尝试实现的相同,因为任何复制操作都会在任何处理或索引发生之前发生(更新处理器,IIRC 除外)。

关于java - Solr复制字段复制到另一个字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51724821/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com