Stopwords are words that have little lexical meaning or ambiguous meaning and are not useful during a search (ex. and, or, the, a, with, etc). Therefore, these words should be removed from search phrases to make them relevant.
You can either manually add stopwords, or import them from YAML-formatted file.
- Go to the System -> Search Management -> Manage Stopwords grid and press Add New Stopword button.
- On the creation page, fill in the following fields:
- Stopword - is the keyword which should be removed from search requests.
- Store View - allows you to select where defined synonyms will be applied.
- Save record.
Our extension uses the YAML file format for stopwords importing. It should resemble the following format:
[ID_1]:[Stopword_1] [ID_2]:[Stopword_2] [ID_3]:[Stopword_3]
The name of this file should be equal to your language code in capital case. Codes can be found here, use column 639-1 for that.
ExampleLet's create a stopwords file for English locale. The name of such a file would be
EN.yaml, and its content should be:
1:"but" 2:"now" 3:"what" 4:"except"
To import stopwords from such a file, perform the following steps:
- Place your custom YAML file to the special
- Go to System -> Search Management -> Manage Stopwords and press Import Stopwords button.
- Dictionary field defines locale (language), for which stopwords are imported. It is picked from the name of your YAML import files.
- Store View defines storeview, where imported stopwords should be applied.
- Press Import to import and apply stopwords.