Describe the problem you solved, how you modelled data, and what you implemented. A strong example answer: What we used it for "We used Elasticsearch (Amazon OpenSearch Service in AWS) to power product and document search: full-text search with relevance ranking, filters and facets, autocomplete, and near real-time indexing of new records. Our relational database remained the source of truth." What I implemented 1. Index design and mappings - Defined explicit mappings instead of dynamic mapping: text fields with analyzers for full-text search, keyword fields for exact filters, sorting and aggregations, and numeric or date fields for ranges. - Custom analyzers: lowercase, ASCII folding, synonyms (for example "tv" and "television"), and an edge n-gram analyzer for search-as-you-type. - Used index aliases so we could reindex into a new index and switch the alias with zero downtime. 2. Indexing pipeline - When records changed, the API published an event (outbox pattern); a background worker consumed it and updated Elasticsearch through the bulk API. - A full reindex job rebuilt the index from the database when mappings changed. - Handled failures with retries and a dead-letter queue, and made indexing idempotent by using the database ID as the document ID. 3. Search queries - bool queries combining multi_match on name and description (with field boosting), filter clauses for category, price range and availability (filters are cached and do not affect scoring), and function_score to boost popular or recent items. - Aggregations for facet counts (brands, categories, price buckets). - Highlighting of matching terms, and search_after for deep pagination instead of large from/size values. - Autocomplete using a completion suggester or edge n-grams. 4. .NET integration - Used the official Elastic .NET client (Elastic.Clients.Elasticsearch) in a search service behind an ASP.NET Core API, with timeouts, cancellation and caching of popular queries. 5. Operations - Monitored cluster health, shard sizes, query latency and indexing rate; tuned the number of shards and replicas; used index lifecycle management for logs. Results: "Search latency dropped from about 2 seconds with SQL LIKE queries to under 100 ms, with typo tolerance and facets that SQL could not provide easily." Also mention the classic ELK use case (Elasticsearch, Logstash or Beats, and Kibana for centralised logging) if you used it.
Ravindra Wadile · · 0 likes