Haskell Elasticsearch client and query DSL
Go to file
2018-06-28 08:06:46 -05:00
examples Merged 2018-04-07 16:25:48 -05:00
src Don't bother parsing JVM version numbers either 2018-05-06 12:51:00 -05:00
tests Resized arbitrary instance for UpdatableIndexSetting\' 2018-05-05 17:20:11 -05:00
.gitignore Test suite rewrite 2018-02-06 21:32:20 -06:00
.hlint.yaml hlint, weeder 2018-02-13 15:47:43 -06:00
.travis.yml update stack 2018-06-28 08:06:46 -05:00
bloodhound.cabal Semverification 2018-05-05 16:48:05 -05:00
bloodhound.jpg der hund 2014-04-12 05:12:17 -05:00
changelog.md Add a test and changelog history. 2018-05-04 09:39:42 -04:00
DSL.org Fix typo: ElasticSearch -> Elasticsearch 2018-04-01 12:28:48 +09:00
LICENSE flipped license to BSD3 for the name provision. 2014-11-01 11:27:32 -05:00
Makefile Index flushing, echo silence 2018-04-15 20:58:15 -05:00
README.md Fix typo: ElasticSearch -> Elasticsearch 2018-04-01 12:28:48 +09:00
Setup.hs doctests cleanup 2015-07-17 22:38:28 -05:00
stack-8.0.yaml un-vendor quickcheck-arbitrary-template 2018-02-06 22:09:03 -06:00
stack-8.2.yaml Semverification 2018-05-05 16:48:05 -05:00
stack.yaml Default to 8.2.2 and LTS 10.0 2017-12-20 22:39:20 -06:00
upload-docs.sh deps in Cabal got mangled 2015-07-16 16:56:17 -05:00

Bloodhound TravisCI Hackage

Bloodhound (dog)

Elasticsearch client and query DSL for Haskell

Why?

Search doesn't have to be hard. Let the dog do it.

Endorsements

"Bloodhound makes Elasticsearch almost tolerable!" - Almost-gruntled user

"ES is a nightmare but Bloodhound at least makes it tolerable." - Same user, later opinion.

Version compatibility

As of version 0.13.0.0, Bloodhound has 2 separate module trees for Elasticsearch versions 1 and 5. Import the module that is appropriate for your use case. If you would like to add support for another major version, open a ticket expressing your intend and follow the pattern used for other versions. We weighed the idea of sharing code between versions but it just got too messy, especially considering the instability of the Elasticsearch API. We switched to a model which would allow the persons responsible for a particular protocol version to maintain that version while avoiding conflict with other versions.

See our TravisCI for a listing of Elasticsearch version we test against.

Stability

Bloodhound is stable for production use. I will strive to avoid breaking API compatibility from here on forward, but dramatic features like a type-safe, fully integrated mapping API may require breaking things in the future.

Testing

The TravisCI tests are run using Stack. You should use Stack instead of cabal to build and test Bloodhound to avoid compatibility problems. You will also need to have an Elasticsearch instance running at localhost:9200 in order to execute some of the tests. See the "Version compatibility" section above for a list of Elasticsearch versions that are officially validated against in TravisCI.

Steps to run the tests locally:

  1. Dig through the [past releases] (https://www.elastic.co/downloads/past-releases) section of the Elasticsearch download page and install the desired Elasticsearch versions.
  2. Install [Stack] (http://docs.haskellstack.org/en/stable/README.html#how-to-install)
  3. In your local Bloodhound directory, run stack setup && stack build
  4. Start the desired version of Elasticsearch at localhost:9200, which should be the default.
  5. Run stack test in your local Bloodhound directory.
  6. The unit tests will pass if you re-execute stack test. If you want to start with a clean slate, stop your Elasticsearch instance, delete the data/ folder in the Elasticsearch installation, restart Elasticsearch, and re-run stack test.

Hackage page and Haddock documentation

http://hackage.haskell.org/package/bloodhound

Elasticsearch Tutorial

It's not using Bloodhound, but if you need an introduction to or overview of Elasticsearch and how to use it, you can use this screencast.

Examples

See the examples directory for example code.

Contributors

Possible future functionality

Span Queries

Beginning here: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-first-query.html

Function Score Query

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html

Node discovery and failover

Might require TCP support.

Support for TCP access to Elasticsearch

Pretend to be a transport client?

Bulk cluster-join merge

Might require making a lucene index on disk with the appropriate format.

GeoShapeQuery

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html

GeoShapeFilter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-filter.html

Geohash cell filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geohash-cell-filter.html

HasChild Filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-child-filter.html

HasParent Filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-parent-filter.html

Indices Filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-indices-filter.html

Query Filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-filter.html

Script based sorting

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_script_based_sorting

Collapsing redundantly nested and/or structures

The Seminearring instance, if deeply nested can possibly produce nested structure that is redundant. Depending on how this affects ES performance, reducing this structure might be valuable.

Runtime checking for cycles in data structures

check for n > 1 occurrences in DFS:

http://hackage.haskell.org/package/stable-maps-0.0.5/docs/System-Mem-StableName-Dynamic.html

http://hackage.haskell.org/package/stable-maps-0.0.5/docs/System-Mem-StableName-Dynamic-Map.html

Photo Origin

Photo from HA! Designs: https://www.flickr.com/photos/hadesigns/