将多个 SOLR 字段合并为一个

Сombine multiple SOLR fields into one

我几乎没有具有相似模式名称 (text_*) 的动态 Solr 字段,例如"text_1"、"text_2"、"text_3"。我需要将所有这些属性组合成一个多值属性:["text_1"、"text_2"、"text_3"] 我尝试将下一种方法与模式一起使用:

 <dynamicField name="text_*" type="string" stored="true"/>
 <dynamicField name="allTexts"  class="solr.StrField" sortMissingLast="true" docValues="true" multiValued="true" stored="true"/>
 <copyField source="text_*" dest="allTexts"/>

但它不能像 SOLR 一样工作,出现错误:

 Can't load schema /opt/.../managed-schema: Dynamic field name 'allTexts' should have either a leading or a trailing asterisk, and no others.

也许有一些其他方法可以通过字段名称模式将动态字段组合成一个多值字段?

您想定义一个常规字段,而不是一个动态字段(即您输入的字段)。

动态字段要求在名称中的某处出现通配符(因为这就是动态字段 - 它支持字段名称的通配符匹配)。

换成

<field name="allTexts"  class="solr.StrField" sortMissingLast="true" docValues="true" multiValued="true" stored="true" />