Sinônimos e radicalização
Melhore a abrangência da pesquisa de texto completo ensinando ao Elasticsearch as variantes e equivalências das palavras com filtros de tokens de radicalização e de sinônimos.
Sinônimos e radicalização é uma aula grátis de Elasticsearch & Full Text Search Systems no CoddyKit. Esta é a aula 4 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Elasticsearch & Full Text Search Systems, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Elasticsearch & Full Text Search Systems inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
Closing the Vocabulary Gap
Users rarely type the exact words stored in your documents. They search running but your text says run, or they type laptop when the doc says notebook. Two analysis techniques bridge this gap: stemming and synonyms.
What Stemming Does
Stemming reduces words to a common root form. running, runs, and ran may all become run. This means a query matches regardless of the grammatical form used.
Algorithmic Stemmers
Elasticsearch ships algorithmic stemmers like porter_stem and the language-aware stemmer filter. They apply rules to strip suffixes quickly without a dictionary.
"filter": {
"my_stemmer": {
"type": "stemmer",
"language": "english"
}
}Dictionary Stemmers
Dictionary stemmers such as hunspell use real word lists for more accurate, linguistically correct roots. They are slower and need dictionary files but avoid over-stemming.
Over- and Under-Stemming
Stemming has failure modes:
- Over-stemming: unrelated words map to the same root (e.g.
universeanduniversity). - Under-stemming: related words fail to share a root.
Use keyword_marker to protect specific words from stemming.
What Synonyms Do
Synonyms map words with the same meaning to each other. Searching tv can match television. They are applied via a synonym token filter in the analyzer chain.
"filter": {
"my_synonyms": {
"type": "synonym",
"synonyms": [ "tv, television", "laptop, notebook" ]
}
}Equivalent vs Explicit
Synonym rules come in two styles:
- Equivalent (
tv, television): all terms are interchangeable. - Explicit (
i-pod => ipod, music player): the left maps to the right only.
Index-Time vs Search-Time
Synonyms can be applied when indexing or when searching. Search-time synonyms (via synonym_graph) are preferred because you can update the list without re-indexing the whole corpus.
"filter": {
"graph_syns": {
"type": "synonym_graph",
"synonyms_path": "analysis/synonyms.txt"
}
}Multi-Word Synonyms
Multi-word synonyms like ny, new york need the graph-aware synonym_graph filter at search time to be tokenized correctly. The older synonym filter mishandles phrases.
Combining Both
A typical chain applies synonyms first, then stemming, after lowercasing. Order matters: stem after expanding synonyms so all variants get normalized consistently.
"my_analyzer": {
"tokenizer": "standard",
"filter": [ "lowercase", "graph_syns", "my_stemmer" ]
}Testing With _analyze
Always verify your chain with the _analyze API to confirm the produced tokens match your expectations before relying on it in production.
GET my_index/_analyze
{
"analyzer": "my_analyzer",
"text": "running televisions"
}Quick Check
Test your understanding of recall-boosting filters.
Recap
You learned to widen search recall:
- Stemming reduces word forms to a shared root; watch for over/under-stemming.
- Synonyms map equivalent terms; equivalent vs explicit rules behave differently.
- Prefer
synonym_graphat search time for editable, multi-word-safe synonyms. - Verify analyzer output with the
_analyzeAPI.
Perguntas Frequentes
A aula “Sinônimos e radicalização” é grátis?
Sim — o texto completo de “Sinônimos e radicalização” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Elasticsearch & Full Text Search Systems, atualize para CoddyKit PRO. O curso de Elasticsearch & Full Text Search Systems inclui 4 aulas no total.
O que vou aprender em “Sinônimos e radicalização”?
Melhore a abrangência da pesquisa de texto completo ensinando ao Elasticsearch as variantes e equivalências das palavras com filtros de tokens de radicalização e de sinônimos. Você pratica Elasticsearch & Full Text Search Systems com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Elasticsearch & Full Text Search Systems?
Nenhuma experiência prévia é necessária. Elasticsearch & Full Text Search Systems no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 4 de 4.
Quanto tempo leva a aula “Sinônimos e radicalização”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Elasticsearch & Full Text Search Systems?
Sim. Cada aula de Elasticsearch & Full Text Search Systems inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Analisadores, tokenizadores e filtros
- Personalização dos analisadores de texto
- Impulsionamento e pontuação de relevância
- Sinônimos e radicalização