NOTE

1.2 Elasticsearch Index Implementation

English translation of the original VNote ‘Elasticsearch Index Implementation’, preserving its examples, structure, and references.

Elasticsearch / SearchCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What Is an Inverted Index?

  • Inverted Index.md (related note not yet public)

2. How Elasticsearch’s Inverted Index Works

For example, there are two documents:

1 Mother loves father
2 He likes dogs

Search for Father likes cat.

2.1. Build the Index

  1. First, tokenize the text.
Mother
loves
father
He
likes
dogs
  1. Then normalization: convert things such as tense and singular/plural forms.
mother
love
father
he
like
dog
  1. Finally, record the relationship between terms and documents.
mother 1
love 1
father 1
he    2
like    2
dog      2
  1. First, tokenize the query.
Father
likes
cat
  1. Then normalization: convert things such as tense and singular/plural forms.
father
like
cat
  1. Finally, match the mapping relationships: both documents will be returned.

3. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub