Skip to main content

Stopwords API

Manage stopwords — the same entities the Stopwords screen edits. All endpoints require authentication and the Mirasvit_Search::search_stopword ACL resource.

Stopword object

FieldDescriptionTypeRequired
idUnique stopword identifierIntRead-only
termA single word to drop from search queriesStringYes
store_idStore view the stopword applies to; 0 means all store viewsIntNo
note

The term is normalised before it is stored — trimmed and lowercased — exactly as the admin form and the CSV import normalise it. A term of " ZorbLat " is stored as zorblat.


Get stopword

GET /rest/V1/mst-search/stopwords/:stopwordId

Response:

{
"id": 4,
"term": "zorblat",
"store_id": 0
}

Errors: 404 — no stopword with that ID.


List stopwords

GET /rest/V1/mst-search/stopwords?searchCriteria

Supports filtering and pagination.

Response:

{
"items": [
{ "id": 1, "term": "zorblat", "store_id": 0 }
],
"search_criteria": { "filter_groups": [], "page_size": 2 },
"total_count": 1
}

Example — every stopword that applies to store view 1, which means the store's own rows and the global ones:

GET /rest/V1/mst-search/stopwords
?searchCriteria[filter_groups][0][filters][0][field]=store_id
&searchCriteria[filter_groups][0][filters][0][value]=0,1
&searchCriteria[filter_groups][0][filters][0][condition_type]=in

Create stopword

POST /rest/V1/mst-search/stopwords

Request body:

{
"stopword": {
"term": "zorblat",
"store_id": 0
}
}

Response: the created stopword with id assigned and term normalised.

Errors: 400Stopword term cannot be empty. when term is missing, empty, or only whitespace.


Update stopword

PUT /rest/V1/mst-search/stopwords/:stopwordId

This is a partial update: only the fields present in the body are applied. Sending just a scope leaves the term untouched:

{
"stopword": {
"store_id": 1
}
}

Response: the updated stopword.

Errors: 404 — no stopword with that ID. 400 — an explicitly empty term.


Delete stopword

DELETE /rest/V1/mst-search/stopwords/:stopwordId

Response:

true

Errors: 404 — no stopword with that ID.

note

Stopwords are applied at query time — the list is read from the database on each search request — so a write needs no reindex. See the write contract.


Bulk import

To load a long list, the CSV import described in Stopwords is usually a better fit than a request per word. The API is the better fit when the list is maintained in another system and has to stay in sync.