Skip to the content.

1. What is Apache Lucene?

πŸ‘‰ Think of Lucene as the β€œengine”, and tools like Elasticsearch or Apache Solr as the β€œcar” built on top of it.


2. Why do we use Lucene?

Lucene gives you:


3. How Lucene relates to Elasticsearch & Solr

πŸ‘‰ Both Elasticsearch and Solr rely on Lucene internally to actually store and search data.


4. How data goes into Lucene

When you index data into Lucene (directly or via Elasticsearch/Solr):

  1. The text is broken into tokens (words).
  2. Tokens are stored in inverted index (word β†’ list of documents).

    • Example:

      "apple is red" β†’ {"apple": [doc1], "red": [doc1]}
      "apple is green" β†’ {"apple": [doc1, doc2], "green": [doc2]}
      
    • Searching for β€œapple” is just a lookup β†’ super fast.


5. Why Lucene is so fast


6. Who uses Lucene directly?


βœ… In short: