skip to Main Content

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


  1. Your destination for copy field are wrong.

    “dest”: “text”

    You don’t have any field with “text” name, only field type with “text” name.

    Login or Signup to reply.
  2. 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"/> 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search