简体   繁体   English

Apache solr 7.4:“copyField dest :'text' 不是显式字段,与 dynamicField 不匹配

[英]Apache solr 7.4 : "copyField dest :'text' is not an explicit field and doesn't match a dynamicField

I am using Apache Solr 7.4.我正在使用 Apache Solr 7.4。 I am trying to use curl/postman to define some portions of my schema.我正在尝试使用 curl/postman 来定义我的架构的某些部分。

I was able to define field type and fields successfully, when I try to define a copy-field I am getting an error :我能够成功定义字段类型和字段,当我尝试定义复制字段时出现错误:

"copyField dest :'text' is not an explicit field and doesn't match a dynamicField

Here's my field type definition :这是我的字段类型定义:

   "add-field-type": {
"name": "text",
"class": "solr.TextField",
"positionIncrementGap": "100",
"indexAnalyzer": {
  "charFilters": [{
    "class": "solr.MappingCharFilterFactory",
    "mapping": "mapping-ISOLatin1Accent.txt"
  }],
  "tokenizer": {
    "class": "solr.KeywordTokenizerFactory"
  },
  "filters": [{
      "class": "solr.LowerCaseFilterFactory"
    },
    {
      "class": "solr.StopFilterFactory",
      "ignoreCase": "true",
      "words": "stopwords.txt"
    },
    {
      "class": "solr.RemoveDuplicatesTokenFilterFactory"
    }
  ]
},
"queryAnalyzer": {
  "charFilters": [{
    "class": "solr.MappingCharFilterFactory",
    "mapping": "mapping-ISOLatin1Accent.txt"
  }],
  "tokenizer": {
    "class": "solr.KeywordTokenizerFactory"
  },
  "filters": [{
      "class": "solr.LowerCaseFilterFactory"
    },
    {
      "class": "solr.StopFilterFactory",
      "ignoreCase": "true",
      "words": "stopwords.txt"
    },
    {
      "class": "solr.LowerCaseFilterFactory"
    },
    {
      "class": "solr.RemoveDuplicatesTokenFilterFactory"
    }
  ]
}

} }

I also added a dynamic field :我还添加了一个动态字段:

  "add-dynamic-field":{
 "name":"*_txt1",
 "type":"text",
 "stored":true,
 "indexed":true

} }

Here's my field :这是我的领域:

 "add-field": [{
  "name": "path",
  "type": "string",
  "indexed": "true",
  "stored": "false"
}

Its successful upto this.它成功了。 Now I am trying to add a copy field as below :现在我正在尝试添加一个复制字段,如下所示:

"add-copy-field":
 {
  "source":"path",
  "dest": "text"
 }

And this is where it is failing.这就是它失败的地方。 Stuck at this, any help is appreciated.坚持这一点,任何帮助表示赞赏。 Thanks!谢谢!

Your destination for copy field are wrong.您复制字段的目的地是错误的。

“dest”: “text” “dest”:“文本”

You don't have any field with “text” name, only field type with “text” name.您没有任何带有“文本”名称的字段,只有带有“文本”名称的字段类型。

Make sure you have all the source and destination fields before making the copy fields.在制作复制字段之前,请确保您拥有所有源和目标字段。 For example if you want to copy two source fields to the destination field.例如,如果您要将两个源字段复制到目标字段。 Make sure all of those fields exist first.首先确保所有这些字段都存在。

<field name="destination" type="text" indexed="true" stored="true" required="false"/> 
<field name="source1" type="text" indexed="false" stored="true" required="false" /> 
<field name="source2" type="text" indexed="false" stored="true" required="false" /> 

Then only you can make copy fields.那么只有您可以制作复制字段。

<copyField source="source1" dest="destination"/> 
<copyField source="source2" dest="destination"/> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM