NOTE
1.2 Elasticsearch Index Implementation
Elasticsearch associates terms with documents through inverted indexes. These notes use two example documents to explain how indexing organizes and retrieves data.
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 normalize grammatical voice, singular/plural forms, and so on.
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 normalize grammatical voice, singular/plural forms, and so on.
father
like
cat
- Finally, match the mapping relationships: both documents will be returned.
3. References
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub