StemmerPublic Preview
The stemmer
filter reduces words to their base or root form (known as stemming), making it easier to match words with similar meanings across different inflections. The stemmer
filter supports multiple languages, allowing for effective search and indexing in various linguistic contexts.
Configuration
The stemmer
filter is a custom filter in Zilliz Cloud. To use it, specify "type": "stemmer"
in the filter configuration, along with a language
parameter to select the desired language for stemming.
- Python
- Java
analyzer_params = {
"tokenizer": "standard",
"filter":[{
"type": "stemmer", # Specifies the filter type as stemmer
"language": "english", # Sets the language for stemming to English
}],
}
Map<String, Object> analyzerParams = new HashMap<>();
analyzerParams.put("tokenizer", "standard");
analyzerParams.put("filter",
Collections.singletonList(
new HashMap<String, Object>() {{
put("type", "stemmer");
put("language", "english");
}}
)
);
The stemmer
filter accepts the following configurable parameters.
Parameter | Description |
---|---|
| Specifies the language for the stemming process. Supported languages include: |
The stemmer
filter operates on the terms generated by the tokenizer, so it must be used in combination with a tokenizer. For a list of tokenizers available in Zilliz Cloud, refer to Tokenizer Reference.
After defining analyzer_params
, you can apply them to a VARCHAR
field when defining a collection schema. This allows Zilliz Cloud to process the text in that field using the specified analyzer for efficient tokenization and filtering. For details, refer to Example use.
Example output
Here’s an example of how the stemmer
filter processes text:
Original text:
"running runs looked ran runner"
Expected output (with language: "english"
):
["run", "run", "look", "ran", "runner"]