Matthew Richardson created SOLR-17613:
-----------------------------------------

             Summary: Unable to add stop/prod words using curl example from 
Solr documentation
                 Key: SOLR-17613
                 URL: https://issues.apache.org/jira/browse/SOLR-17613
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: SolrJ
            Reporter: Matthew Richardson


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.

I posted this to the solr users group in late September and got no reply.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to