Official clients exist for Java, JavaScript, Python, .NET, Go, PHP and Ruby. They handle connection pooling, retries, node sniffing and auth. Concern Tip Auth API keys (ApiKey) or service accounts — not the elastic superuser TLS verify certificates (caFingerprint / CA file) Bulk loading client bulk helpers handle batching, retries and backpressure Timeouts set request timeouts; long searches → async search Index naming read/write through aliases Testing Testcontainers with the official image Keep search logic (query building) in one module so relevance tuning doesn't require touching every caller.
Key Takeaways
Use the official client with API-key auth and TLS verification.
The bulk helper batches, retries and reports dropped documents.
Centralise query building so relevance changes happen in one place.
Read the total from hits.total.value and facets from aggregations.