How jrtrj/searchengine works
This is a small Go search-engine demo: its command creates three hard-coded documents, indexes their body text, searches a hard-coded query, and prints matching document IDs. The index tokenizes both document bodies and queries, storing term-to-posting lists in memory; search returns sorted IDs. Titles are modeled but not indexed, and there is no persistent storage or interactive input. The graph reflects the sampled implementation, not additional search capabilities.
Main entry points: index.go Inverted index · main.go Demo entry point · tokenizer.go Tokenizer · document.go Document model
Components 6
Other components
- Demo entry point
cmd/searchengine/main.go - Document model
internal/model/document.go - Inverted index
internal/index/index.go - Term postings
internal/index/index.go - Tokenizer
internal/tokenizer/tokenizer.go - Terminal output
Connections 9
- Demo entry point → Document model: creates
- Demo entry point → Inverted index: adds documents
- Demo entry point → Inverted index: searches
- Inverted index → Tokenizer: tokenizes bodies
- Inverted index → Tokenizer: tokenizes query
- Inverted index → Term postings: writes postings
- Inverted index → Term postings: reads postings
- Inverted index → Demo entry point: returns IDs
- Demo entry point → Terminal output: prints results