The Stopwords REST API manages the stop words file for a collection. Only a one general set of stop words can be defined using this REST API. If you need different sets of stop words for different field types (perhaps for different languages), you will need to edit the schema.xml and manually manage the stop word files.
When updating the stop words, please note that only PUT requests are supported and any new data sent will overwrite the previous stop words. As such, PUT requests can be seen as replacement requests.
List or Update Stop Words
The path for this request is:
where <collectionName> is the name of an specific collection.
A GET request will return the stop words in JSON format. A PUT request will replace the existing stop words with the new list.
These endpoints also allow for import and export of the stop words list. To download the list, replace the Content-Type in the GET request to "`Accept: application/octet-stream"`. To upload a file, you can emulate an HTTP form with cURL’s "-form" option, as in
A JSON format list of stop words.
A GET request will return the current stop words list, in JSON format.
No data will be returned for a PUT request.
|Use port 8765 in local development environments only. In production, use port 8764.|
Update the stop words list with a new list of stop words:
curl -u user:pass -X PUT -H 'Content-type: application/json' -d '["a", "and", "of", "the"]' http://localhost:8764/api/apollo/stopwords/docs
List the current stop words list:
curl -u user:pass http://localhost:8764/api/apollo/stopwords/docs
[ "a", "and", "of", "the" ]
Upload a stop words file:
curl -u user:pass -X PUT --form email@example.com http://localhost:8764/api/apollo/stopwords/docs
Download a stop words list & save it as a file named "stopwords.txt":
curl -H "Accept: application/octet-stream" http://localhost:8764/api/apollo/stopwords/docs > stopwords.txt