NOTE
1.2 Elasticsearch Index Implementation
English translation of the original VNote ‘Elasticsearch Index Implementation’, preserving its examples, structure, and references.
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
- First, tokenize the text.
Mother
loves
father
He
likes
dogs
- Then normalization: convert things such as tense and singular/plural forms.
mother
love
father
he
like
dog
- Finally, record the relationship between terms and documents.
mother 1
love 1
father 1
he 2
like 2
dog 2
2.2. Search
- First, tokenize the query.
Father
likes
cat
- Then normalization: convert things such as tense and singular/plural forms.
father
like
cat
- Finally, match the mapping relationships: both documents will be returned.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub