How mrshd3im05/gosearch works
gosearch is a small, dependency-free Go search engine. The main workflow is: a client submits JSON documents through the HTTP API; the API stores them and updates the inverted index; search queries are tokenized, expanded and scored, then matching documents are retrieved for the response. A separate live-test console calls the API, and an optional database-search path reads current SQL rows and searches them through the same index implementation. The graph reflects README-documented features where source excerpts are incomplete; those links are cited to the README rather than implying unsampled code was inspected.
Main entry points: server.go REST API · gosearcher.go Table search · index.go Inverted index · index.html Web console
Components 13
Entry points
- Backend command
cmd/gosearch/main.go - SQL search command
cmd/sqlsearch/main.go - Console file server
cmd/webtest/main.go
HTTP product
- REST API
pkg/api/server.go - Document store
pkg/storage/store.go - Course corpus
pkg/samples/courses.go
Search core
- Inverted index
pkg/search/index.go - Unicode tokenizer
pkg/analyze/analyzer.go
Database search
- Table search
pkg/gosearcher/gosearcher.go
Live-test console
- Web console
web/index.html
Other components
- API client
- SQL database
- Browser user
Connections 14
- Backend command → REST API: starts
cmd/gosearch/main.go - API client → REST API: sends requests
README.md - REST API → Document store: writes and reads
pkg/api/server.go - REST API → Inverted index: updates and searches
pkg/api/server.go - REST API → Course corpus: loads corpus
pkg/api/server.go - Inverted index → Unicode tokenizer: tokenizes text
pkg/search/index.go - REST API → Table search: delegates table search
pkg/api/server.go - SQL search command → Table search: calls search
cmd/sqlsearch/main.go - Table search → SQL database: reads live rows
pkg/gosearcher/gosearcher.go - Table search → Inverted index: indexes and queries rows
pkg/gosearcher/gosearcher.go - Backend command → Table search: optionally links
cmd/gosearch/main.go - Console file server → Web console: serves files
cmd/webtest/main.go - Browser user → Web console: opens console
README.md - Web console → REST API: calls API
README.md