That one constraint completely changed how I built my project.
For the hackathon, I built JSearch, an embedded search engine written entirely with the Java standard library.
No Lucene.
No Elasticsearch.
No external parser.
No database.
Zero external dependencies.
Normally, building search functionality would start with a simple question:
Which library should I use?
This time, that question wasn't available.
Instead, every feature started with:
How does this actually work underneath?
I initially thought a search engine would be relatively straightforward:
Read documents → tokenize words → build an inverted index → search.
Then the real problems started showing up.
I wanted phrase search.
"spring boot"
That meant knowing more than which documents contained a word. I had to store word positions.
I wanted Boolean queries.
java AND (spring OR redis)
That meant building a query tokenizer and parser, handling operators, precedence, and parentheses.
Then came persistence.
An in-memory index disappears when the program stops. Without using a database or serialization library, I had to design how the index would be stored, loaded, and safely updated.
That led to things like persistent index storage, temporary writes, and snapshots.
By the end, JSearch included:
• Tokenization and normalization
• Inverted indexes
• Positional postings
• Boolean search
• Phrase search
• Query parsing
• Persistent storage
• Snapshot-based updates
• A CLI for indexing and searching
All built from scratch.
The biggest lesson from this zero-dependency hackathon wasn't that dependencies are bad.
Quite the opposite.
It made me appreciate them more.
Libraries like Lucene represent years of engineering compressed behind a simple API.
When you can't install them, you start discovering all the problems they quietly solve for you.
The zero-dependency constraint forced me to stop thinking:
"What can I import?"
and start thinking:
"What would I need to build?"
That was probably the most valuable part of building JSearch.
🔗 GitHub: https://github.com/Saishiva3000/Jsearch---embedded-search-engine
Top comments (0)