The 30 second answer
A core search API turns product intent into Elasticsearch queries in one place. It owns the query language, the client library and its upgrades, guardrails on expensive query shapes, caller identification, and the composition of ranking and other search services. Product teams ask for search, not raw DSL. Zalando's upgrade post describes its Origami service this way, as the connector that coordinates search intelligence on top of Elasticsearch.
What Zalando has published. Its Elasticsearch upgrade post names the main application that talks to Elasticsearch: Origami, quoted from its internal description as "the Zalando Core Search API", providing "a powerful information retrieval language and engine" that integrates microservices built by the search department and is "the connector - coordinating all search intelligence to serve correct search results to customers". It builds on Elasticsearch and internal APIs for search and discovery, navigation and analytics. The post says it is written in Scala and large (443k lines across 846 files, including configs, tests and test resources), and that most of the upgrade work was migrating its Elasticsearch client. A later Zalando post on a search outage describes layers such as a query builder, a catalog API and a lightweight Search API in front of the cluster. The public posts do not map those names onto each other, so in an interview talk about responsibilities, not about which box is which.
Why have the layer at all.
- One query language. Product teams express intent (text, filters, sort, page, market) and the layer turns it into Elasticsearch DSL. Mappings, analyzers and index names can change without touching every caller.
- One client to upgrade. When the Elasticsearch client changes, as with the deprecated High Level REST Client in the upgrade post, one codebase changes. The REST compatibility mode and the three-way client and cluster test matrix described in that post are only practical because there is one caller.
- Guardrails. The layer is where you enforce which fields may be aggregated, maximum
sizeand pagination depth, timeouts, and terminate-after limits. The outage post's follow-ups (application-side query limits with dynamic thresholds, rate limits by client type) live naturally here. - Caller identity. It can attach
X-Opaque-Idper calling service, so slow logs and the task API show who sent an expensive query. - Composition. Query understanding, retrieval, re-ranking, promotions and fallbacks are orchestrated with a latency budget per step, and with A/B variants of query shapes.
- Load control. During incidents the presentation layers act as a control plane: fewer parallel queries per request, more caching for hot queries, cheaper ranking fallbacks, which is what the outage post describes.
The risks to name. A central layer can become a bottleneck for every product change and a single point of failure. Mitigate with clear extension points (configuration-driven query templates, feature flags), independent deployability, horizontal scaling, strict per-dependency timeouts, and ownership boundaries so teams are not blocked on one backlog.
Alternate interview scenarios
"A product team wants raw Elasticsearch access for a new feature. Do you allow it?"
I would rather add the capability to the search API, because direct access bypasses the guardrails and the client upgrade path, and the outage post shows how one unmonitored internal caller can degrade search for everyone. If speed matters, I would agree a narrow, read-only endpoint with fixed query templates, a caller id, a timeout and a quota, instead of open DSL.
"How would you migrate a large search API to a new Elasticsearch client safely?"
Put an internal interface in front of the client so most code depends on it, run the old client in compatibility mode against the new cluster first, and add contract tests that run the important query shapes against both cluster versions in containers. Then migrate call sites in slices behind flags, comparing responses from both paths in shadow mode before switching.
Sources (3)
- Zalando Engineering: Migrating From Elasticsearch 7.17 to Elasticsearch 8.x: Pitfalls and Learningsengineering.zalando.com
- Zalando Engineering: The Day Our Own Queries DoS'ed Us: Inside Zalando Searchengineering.zalando.com
- Elasticsearch: API conventions (X-Opaque-Id)elastic.co