Stopwords API

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:

/api/apollo/stopwords/<collectionName>

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 -form file=@stopwords.txt.

Input

A JSON format list of stop words.

Output

A GET request will return the current stop words list, in JSON format.

No data will be returned for a PUT request.

Examples

Note
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:

REQUEST

curl -u user:pass -X PUT -H 'Content-type: application/json' -d '["a", "and", "of", "the"]' http://localhost:8764/api/apollo/stopwords/docs

RESPONSE

None.

List the current stop words list:

REQUEST

curl -u user:pass http://localhost:8764/api/apollo/stopwords/docs

RESPONSE

[ "a", "and", "of", "the" ]

Upload a stop words file:

REQUEST

curl -u user:pass -X PUT --form file=@stopwords.txt http://localhost:8764/api/apollo/stopwords/docs

RESPONSE

None.

Download a stop words list & save it as a file named "stopwords.txt":

REQUEST

curl -H "Accept: application/octet-stream" http://localhost:8764/api/apollo/stopwords/docs > stopwords.txt

RESPONSE

None.