lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arturas Mazeika <>
Subject schema-api: modifying schema in xml format
Date Wed, 18 Apr 2018 08:12:17 GMT
Hi solr-users,

is it possible to modify the managed schema using schema api and submit the
commands in XML format? I am able to add a data type using:

curl -X POST -H 'Content-type:application/json' --data-binary '{
  "add-field-type": {
  "analyzer": {
    "tokenizer": {"class":"solr.StandardTokenizerFactory"},
    "filters": [
      {"class":"solr.StopFilterFactory", "format":"snowball",
"words":"lang/stopwords_de.txt", "ignoreCase":true},
      {"class":"solr.PhoneticFilterFactory", "encoder":"DoubleMetaphone"}
}' http://localhost:8983/solr/tph/schema

so I thought I could submit something like:

curl -X POST -H 'Content-Type: text/xml' --data-binary '
<add-field-type name="text_de_ph" class="solr.TextField"
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.LowerCaseFilterFactory"/>
      <filter class="solr.StopFilterFactory" format="snowball"
words="lang/stopwords_de.txt" ignoreCase="true"/>
      <filter class="solr.GermanNormalizationFilterFactory"/>
      <filter class="solr.GermanLightStemFilterFactory"/>
      <filter class="solr.PhoneticFilterFactory" encoder="DoubleMetaphone"/>
' http://localhost:8983/solr/tph/schema

This however failed with the error:

    "msg":"JSON Parse Error: char=<,position=1 AFTER=' ...

The examples in the documentation (I am using solr 7.2) are all in JSON
format, but does not say explicitly, that one needs to send the updates in
json format only..



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message