简体   繁体   中英

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. I am trying to use curl/postman to define some portions of my schema.

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”

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"/> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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