Strapi & Elasticsearch
Build the mental models behind a headless CMS and a search engine, and how they fit together. You'll model content types in Strapi and query its auto-generated API, then learn how Elasticsearch tokenizes documents into an inverted index, matches queries with mappings and bool logic, and ranks results by relevance — each concept paired with a runnable model you can read and run.
5 lessons · ~2 hours
1. Content and Search
Strapi content types
A content type is a schema editors use — fields with types and rules that every entry must satisfy.
The Strapi API: REST & GraphQL
Strapi auto-generates REST and GraphQL endpoints from your content types, with filters and populate for relations.
Elasticsearch: the inverted index
Elasticsearch tokenizes documents and builds an inverted index mapping each term to the documents that contain it.
Mappings & queries
Mappings give fields a type — text vs keyword — and bool queries combine must, should, and filter clauses.
Relevance & scoring
Matching documents are ranked by a relevance score, and term frequency is the core intuition behind it.