无法在我在 schema.xml 中定义的字段中搜索,例如 copyField

Can not search in the field which I defined in schema.xml like copyField

我已通过以下方式将多值字段添加到 schema.xml:

<field name="text_qs" type="text" indexed="true" stored="false" multiValued="true"/>

并向其中添加了两个字段:

<copyField source="name" dest="text_qs"/>
<copyField source="symbol" dest="text_qs"/>

之后我对solr进行了索引,重新启动了它,但我仍然无法在这个字段中搜索text_qs。 我在 solr admin http://localhost:8061/solr/admin/.

中通过搜索 text_qs:ge 检查了它

你能问问有人为什么吗?

总的来说,我尝试在某些领域创建搜索。因为现在我们可以在字段 text_def 中搜索,也就是 <defaultSearchField>text_def</defaultSearchField>。 此字段 text_def 的定义方式类似:

<field name="text_def" type="text" indexed="true" stored="false" multiValued="true"/>

它只是没有 copyFields:

<copyField source="name" dest="text_def"/>
<copyField source="symbol" dest="text_def"/>
<copyField source="numb" dest="text_def"/>
....

现在当我们输入 'ge' 时,我们会在默认搜索字段 text_def 中搜索此 'ge',然后在字段 'name', 'symbol', 'numb',.... 中搜索 但我们只想在 'name''symbol' 中搜索。这就是我尝试创建字段 text_qs 的原因。

这是否正确?

尝试更改 stored=true

<field name="text_qs" type="text" indexed="true" stored="true" multiValued="true"/>

如果在搜索过程中应该可以检索字段的值,则为真。

抱歉造成混淆。 事实证明,问题出在索引中。执行索引的脚本对这种情况没有用,我不得不使用另一个脚本。 感谢您的帮助!