The documentation for adding stop/prot words to a collection appears to be
incorrect. On this page:

https://solr.apache.org/guide/solr/latest/configuration-guide/managed-resources.html#managing-stop-words

It states that I can add a new stopword with this curl command:

curl -X PUT -H 'Content-type:application/json' --data-binary '["foo"]' "
http://localhost:8983/solr/techproducts/schema/analysis/stopwords/english";

If I modify that to use the default collection "gettingstarted":

curl -X PUT -H 'Content-type:application/json' --data-binary '["foo"]' "
http://localhost:8983/solr/gettingstarted/schema/analysis/stopwords/english";

I get an error:

"error":{

"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],
    "msg":"Expected Map to create a new ManagedResource but received a
java.util.ArrayList",
    "code":400
  }

(I'm using a default install of solr 9.7.0. Starting it up with
/opt/apache/solr-9.7.0/bin/solr start -e cloud)

It looks to me like the input:

["foo"]

should instead be something like:

{"key": ["foo"]}

Does anyone know how to add stop words via curl? If I can figure out how to
do this correctly I could submit a pull request to get the documentation
updated.

-- 
Matthew Richardson (he/him/his), Senior Full Stack Software Engineer
Inter-university Consortium for Political and Social Research, ICPSR

"Intent and outcome are so rarely coincident." -*The Kindly Ones*, Neil
Gaiman

Reply via email to