【问题标题】:Solr Atomic Update error : copyField dest :'title.set_str' is not an explicit field and doesn't match a dynamicFieldSolr 原子更新错误:copyField dest:'title.set_str' 不是显式字段,与 dynamicField 不匹配
【发布时间】:2021-02-23 17:46:49
【问题描述】:

我使用以下托管模式在 Solr 版本 8.5.2 中创建了一个新核心“mycore”:

<?xml version="1.0" encoding="UTF-8"?>
<schema name="default-config" version="1.6">

  <uniqueKey>id</uniqueKey>

  <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" />
  <fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" docValues="true" />

  <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
  <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>

  <fieldType name="pint" class="solr.IntPointField" docValues="true"/>
  <fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
  <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
  <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>

  <fieldType name="pints" class="solr.IntPointField" docValues="true" multiValued="true"/>
  <fieldType name="pfloats" class="solr.FloatPointField" docValues="true" multiValued="true"/>
  <fieldType name="plongs" class="solr.LongPointField" docValues="true" multiValued="true"/>
  <fieldType name="pdoubles" class="solr.DoublePointField" docValues="true" multiValued="true"/>
  <fieldType name="random" class="solr.RandomSortField" indexed="true"/>

  <fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />

  <fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
  <fieldType name="pdates" class="solr.DatePointField" docValues="true" multiValued="true"/>
    
  <fieldType name="binary" class="solr.BinaryField"/>

  <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
    <analyzer type="index">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
    <analyzer type="query">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
      <filter class="solr.SynonymGraphFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
  </fieldType>
  
  <field name="id" type="string" multiValued="false" indexed="true" required="true" stored="true"/>
  <field name="_version_" type="plong" indexed="false" stored="false"/>
  <field name="title" type="text_general" multiValued="false" indexed="true" stored="true"/>
  <field name="abstract" type="text_general" multiValued="false" indexed="true" stored="true"/>
 
</schema>

然后我使用以下命令创建我的第一个文档:

curl -X POST -H 'Content-Type: application/json' 'http://localhost:9293/solr/mycore/update/json/docs?commit=true' --data-binary '
{
  "id": "01",
  "title": "Hello",
  "abstract": "Hello Brave New World!"
}'

但是当我尝试使用命令进行原子更新时:

curl -X POST -H 'Content-Type: application/json' 'http://localhost:9293/solr/mycore/update/json/docs?commit=true' --data-binary '
{
  "id": "01",
  "title": { "set": "Bye" }
}'

我收到错误消息:

"msg":"copyField dest :'title.set_str' 不是显式字段,与动态字段不匹配。"

请问,我做错了什么?

【问题讨论】:

    标签: solr


    【解决方案1】:

    您正在向/update/json/docs 发帖。此端点用于索引原始 JSON 文档。

    通过仅使用 /update 作为您的路径,将您的更新发送到默认更新处理程序。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-03
      • 2018-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-07
      相关资源
      最近更新 更多