elasticsearch-dsl
Version, currently master branch1 version
- master branchlatestOct 8, 2018
github.com/newtonapple/elasticsearch-dsl.cr
A Crystal DSL for Elasticsearch
1 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
elasticsearch-dsl:
github: newtonapple/elasticsearch-dsl.cr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.26.1- License
- MIT
- Author
- David Dai
Dependencies
This version declares no dependencies.
README
elasticsearch-dsl
A Crystal DSL for Elasticsearch. It is partially inspired by the Ruby Elasticsearch DSL.
WARNING:
THIS LIBRARY IS A WORK IN PROGRESS & API IS A MOVING TARGET.
Installation
Add this to your application's shard.yml:
dependencies:
elasticsearch-dsl:
github: newtonapple/elasticsearch-dsl
Usage
require "elasticsearch-dsl"
include Elasticsearch::DSL::Search
include Queries
bool_query = search {
query {
bool {
must(MultiMatch) {
fields ["title^2", "description", "body"]
query "metaprogramming"
}
should(MatchPhrase) {
match_phrase("body") {
query "crystal magic"
}
}
}
}
}
puts bool_query.to_pretty_json
# =>
# {
# "query": {
# "bool": {
# "must": {
# "multi_match":{
# "fields": ["title^2", "description", "body"],
# "query": "metaprogramming"
# }
# },
# "should": {
# "match_phrase": {
# "body": {
# "query": "crystal magic"
# }
# }
# }
# }
# }
# }
Please see spec for more examples.
Contributors
- newtonapple David Dai - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Oct 8, 2018
- Crystal
0.26.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/newtonapple/elasticsearch-dsl.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1