Build Status Coverage Status

An Elasticsearch connector for Dart. Includes both a thin wrapper around the REST API for indexing and querying and a Warehouse companion adapter for easily adding search and ranking to repositories.


A simple usage example:

import 'dart:async';
import 'package:elastic_dart/elastic_dart.dart';

main() async {
  var es = new Elasticsearch();

  await es.createIndex('my_movies', throwIfExists: false);

  await es.bulk([
    {"index": {"_index": "my_movies", "_type": "movies", "_id": "1"} },
    {"name": "The hunger games", "year": "2012" },
    {"index": {"_index": "my_movies", "_type": "movies", "_id": "2"} },
    {"name": "Titanic", "year": "1997" },
    {"index": {"_index": "my_movies", "_type": "movies", "_id": "3"} },
    {"name": "Annabelle", "year": "2014" },
    {"index": {"_index": "my_movies", "_type": "movies", "_id": "4"} },
    {"name": "Star Wars: Episode I - The Phantom Menace", "year": "1999" }

  // Wait for Elasticsearch to index the new documents
  await new Future.delayed(new Duration(seconds: 2));

  var result = await es.search(index: 'my_movies', query: {
    "query": {
      "match": {"name": "The hunger games"}


For usage on the Warehouse adapter see the example folder.

Features and bugs

Please file feature requests and bugs at the issue tracker.



A warpper around the Elasticsearch REST API for indexing and querying