Elasticsearch in unseren Projekten

Heute möchte ich ein Open Source Projekt vorstellen, welches wir mittlerweile in fast allen Projekten einsetzen: ElasticSearch. In diesem Blog-Post möchte ich einen kurzen Überblick zu ElasticSearch geben und aufzeigen, wofür wir es verwenden.

[English version below]

Was ist ElasticSearch?

ElasticSearch ist eine Such-Engine. Ähnlich wie Solr setzt sie auf Lucene auf und ermöglicht fein abgestimmte Volltextsuchen in JSON-Dokumenten. Meine persönliche Highlight-Liste ist die folgende:

  • Runterladen, Starten: Läuft. Die Einstiegshürde für ElasticSearch ist sehr gering; es funktioniert einfach. Man verwendet dann die REST-API, um mit ElasticSearch zu interagieren.
  • Die Suchanfragen werden als JSON formuliert – auch das senkt die Einstiegshürde.
  • Das Such-Verhalten kann sehr fein abgestimmt werden, indem man das "Mapping" verändert. Insgesamt ist ElasticSearch aber schema-frei, d.h. man kann beliebige JSON-Strukturen indizieren.
  • Neben der Suche kann man Daten mit Hilfe der Aggregations-API aufsummieren, gruppieren, etc.
  • ... und das ganze bei einer grandiosen Performance!

Mittlerweile gibt es extrem gute Dokumentation: Neben der Referenz-Doku ist auch ElasticSearch – The Definitive Guide als Handbuch online verfügbar.

Wofür nutzen wir ElasticSearch?

Neben der Verwendung als Such-Engine nutzen wir sie auch als NoSQL-Datenspeicher in unseren Anwendungen, da sich viele Problemstellungen mit Hilfe von cleverer Indizierung und den richtigen Suchanfragen lösen lassen.

  • Wir haben für TYPO3 Neos einen Connector geschrieben, um Inhalte aus Neos ins ElasticSearch zu packen und zu durchsuchen.
  • Bei einigen unserer Kunden nutzen wir ElasticSearch als Cache, welcher langsame Daten-Zugriffe beschleunigt. Wir legen darin auch bspw. Session- und Nutzerdaten ab.
  • Wir nutzen die Facettierungs- und Aggregationsfunktionen zum Darstellen großer Datenmengen.
  • Um Logfiles zu analysieren, hat sich die Kombination von Mozilla Heka mit ElasticSearch und Kibana als gutes Werkzeug erwiesen.

Für uns hat sich ElasticSearch wirklich als "Schweizer Taschenmesser" erwiesen, welches die relationalen Datenbanken, die wir oft in Projekten verwenden, sehr gut ergänzt.

Sprecht uns einfach an, wenn ihr Fragen zu ElasticSearch habt, wir helfen und beraten euch gern!

ElasticSearch in our projects

Today I want to introduce an Open Source Project which we use in nearly all our projects today: ElasticSearch. I will give a short overview of ElasticSearch in this blog post and give you some examples of how we use it.

What is ElasticSearch?

ElasticSearch is a Search-Engine. Similar to Solr it is based on Lucene and allows a fine tuned full-text search in JSON-documents. My personal highlight list of its capabilities is this:

  • Download, start: runs. The entry barrier for ElasticSearch is very low; it just works. You use a REST-API to interact with ElasticSearch once it is running.
  • Search queries are created as JSON - this lowers the entry barrier as well.
  • The search behaviour can be fine tuned to a very high degree by changing the "mapping". Overall ElasticSearch is schema-free, which means that any JSON-structure can be indexed.
  • In addition to Search, the Aggregation-API can be used to sum up or group data an much more
  • ... and all this with an astonishing performance!

Extremely good documentation has been created as well: in addition to the reference documentation the ElasticSearch - The Definitive Guide is available as an online handbook.

What are we using ElasticSearch for?

Next to its obvious use as a search engine, we use it as a NoSQL-data storage in our applications, because many problems can be solved with the help of clever indexing and the right search queries.

  • We have written a TYPO3 Neos connector, to get content from Neos into ElasticSearch and make it searchable.
  • We use ElasticSearch as a cache which speeds up slow data access for some of our clients. We also use it to hold session- and user-data.
  • We use the facet- and aggregation-capabilities to display large amount of data.
  • The combination of Mozilla Heka, ElasticSearch and Kibana has proven to be a great toolset to analyze logfiles.

Elastic Search has proven to be a "Swiss Knife" for us, which complements the relational databases we often use in our projects.

Let us know if you have questions around ElasticSearch, we would love to help and consult you!