0Pricing
Elasticsearch & Full Text Search Systems · レッスン

同義語とステミング

ステミングトークンフィルターや同義語フィルターを使って単語の変化形や同義語をElasticsearchに登録し、全文検索の再現率を高める方法を学びます。

「同義語とステミング」はCoddyKit上の無料Elasticsearch & Full Text Search Systemsレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはElasticsearch & Full Text Search Systems学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Elasticsearch & Full Text Search Systemsコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

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. universe and university).
  • 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_graph at search time for editable, multi-word-safe synonyms.
  • Verify analyzer output with the _analyze API.

よくある質問

「同義語とステミング」レッスンは無料ですか?

はい。「同義語とステミング」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Elasticsearch & Full Text Search Systemsコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Elasticsearch & Full Text Search Systemsコースには全4レッスンが含まれています。

「同義語とステミング」で何を学びますか?

ステミングトークンフィルターや同義語フィルターを使って単語の変化形や同義語をElasticsearchに登録し、全文検索の再現率を高める方法を学びます。 ブラウザで直接実行するハンズオンコードでElasticsearch & Full Text Search Systemsを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Elasticsearch & Full Text Search Systemsを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのElasticsearch & Full Text Search Systemsは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。

「同義語とステミング」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このElasticsearch & Full Text Search Systemsレッスンでコードを書いて実行できますか?

はい。すべてのElasticsearch & Full Text Search Systemsレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. アナライザー、トークナイザー、フィルター
  2. テキストアナライザーのカスタマイズ
  3. ブーストと関連性スコアリング
  4. 同義語とステミング
← Elasticsearch & Full Text Search Systemsに戻る