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!
2
Answers
Your destination for copy field are wrong.
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.
Then only you can make copy fields.