Skip to main content

Elasticsearch

Elasticsearch is a distributed search and analytics engine used for full-text search, log analysis, and real-time data exploration. Appliku supports provisioning Elasticsearch as a managed database container on your server.

Supported Versions

VersionNotes
Elasticsearch 8.17Latest supported release

Provisioning Elasticsearch

  1. Open your application in the Appliku dashboard
  2. On the Application Overview page, scroll to the Databases block (bottom-right sidebar)
  3. Click Add Database
  4. Select Elasticsearch 8.17 from the dropdown
  5. Select the server where Elasticsearch should run
  6. Click Create

Appliku provisions an Elasticsearch Docker container and generates the connection URL automatically.

warning

Elasticsearch is resource-intensive. Ensure your server has adequate RAM (at least 2 GB free, 4 GB+ recommended) before provisioning. Elasticsearch with insufficient memory will crash or perform poorly.

Connection URL

Once provisioned, Appliku injects the Elasticsearch connection URL as an environment variable:

http://host:port

Your application can use this URL to connect to the Elasticsearch instance.

Common Use Cases

Django with django-elasticsearch-dsl

import os

ELASTICSEARCH_DSL = {
"default": {
"hosts": os.environ.get("ELASTICSEARCH_URL", "http://localhost:9200"),
},
}

Direct Connection with elasticsearch-py

from elasticsearch import Elasticsearch
import os

es = Elasticsearch(os.environ.get("ELASTICSEARCH_URL", "http://localhost:9200"))

# Index a document
es.index(index="articles", id=1, body={"title": "Hello", "content": "World"})

# Search
results = es.search(index="articles", body={"query": {"match": {"content": "world"}}})

Resource Considerations

Elasticsearch uses significant memory for indexing and querying. Keep the following in mind:

Server RAMSuitability
1 GBNot recommended
2 GBMinimal workloads only
4 GBSmall to medium datasets
8 GB+Production workloads
tip

If you are running Elasticsearch alongside your application and a PostgreSQL database on the same server, ensure you have enough headroom for all services. Monitor your server's RAM usage from the Appliku dashboard.

Managing Elasticsearch

From the Application Overview page, click Manage in the Databases card to:

  • Start / Stop / Restart the Elasticsearch container
  • View logs for debugging indexing or query issues
  • Delete the instance (all indexed data is lost)

Next Steps