Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Solr 7.4.0将所有带有copyfield的字段搜索到默认字段not working_Solr - Fatal编程技术网

Solr 7.4.0将所有带有copyfield的字段搜索到默认字段not working

Solr 7.4.0将所有带有copyfield的字段搜索到默认字段not working,solr,Solr,我看了很多类似的问题。答案是将所有字段复制到一个字段,并将其设置为默认字段。然而,它仍然不起作用 我的一些领域: <field name="Unit" type="string" docValues="true" indexed="true" stored="true"/> <field name="Amount" type="pdoubles" docValues="true" indexed="true" stored="true"/> <field

我看了很多类似的问题。答案是将所有字段复制到一个字段,并将其设置为默认字段。然而,它仍然不起作用

我的一些领域:

  <field name="Unit" type="string" docValues="true" indexed="true" stored="true"/>
  <field name="Amount" type="pdoubles" docValues="true" indexed="true" stored="true"/>
  <field name="Comment" type="text_general" docValues="true" indexed="true" stored="true"/>

我补充说:

<field name="searchall" type="text_general" multiValued="true" indexed="true" stored="true"/>

(我也尝试了stored=“false”,但都不起作用) 并通过模式API在托管模式下添加我需要的所有copyfields

然后我改变了

<initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
  <lst name="defaults">
    <str name="df">searchall</str>
  </lst>
</initParams>

搜索球
在solrconfig.xml中

当我搜索q=something时,它仍然没有给出任何结果。 有人知道我哪里做错了吗?

作为MatsLindh,别忘了重新编制索引

添加您的copyfields-如果您显式引用该字段而不是使用
df
,它是否有效?更改配置后是否重新编制了索引?如果在添加copyField指令后未重新编制索引,则目标字段中不会有任何内容。对文档编制索引时会执行复制操作

我重新导入数据,它就工作了