{"id":26022949,"url":"https://github.com/agrison/duct-elasticsearch","last_synced_at":"2026-04-15T20:33:08.727Z","repository":{"id":62433598,"uuid":"138175825","full_name":"agrison/duct-elasticsearch","owner":"agrison","description":"Integrant multimethods for connecting to ElasticSearch via Spandex.","archived":false,"fork":false,"pushed_at":"2018-06-21T13:54:54.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-10T16:39:37.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agrison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-21T13:44:50.000Z","updated_at":"2019-09-30T02:43:14.000Z","dependencies_parsed_at":"2022-11-01T20:46:11.463Z","dependency_job_id":null,"html_url":"https://github.com/agrison/duct-elasticsearch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/agrison/duct-elasticsearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fduct-elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fduct-elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fduct-elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fduct-elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrison","download_url":"https://codeload.github.com/agrison/duct-elasticsearch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fduct-elasticsearch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31859460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-06T10:37:34.862Z","updated_at":"2026-04-15T20:33:08.711Z","avatar_url":"https://github.com/agrison.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Duct database.elasticsearch.spandex\n\n[![Build Status](https://travis-ci.org/agrison/duct-elasticsearch.svg?branch=master)](https://travis-ci.org/agrison/duct-elasticsearch)\n\nIntegrant multimethods for connecting to [ElasticSearch][] via [Spandex][].\n\n[elasticsearch]: http://elastic.co\n[spandex]: https://github.com/mpenet/spandex\n\n## Installation\n\nTo install, add the following to your project `:dependencies`:\n\n    [me.grison/duct-elasticsearch \"0.1.0\"]\n\n## Usage\n\nThis library provides two things:\n\n* a `Boundary` record that holds both the Spandex client (`:client`) \n  and a sniffer (`:sniffer`) if asked for.\n* a multimethod for `:duct.database.elasticsearch/spandex` that initiates \n  the client based on those options into the Boundary.\n\nWhen you write functions against the ElasticSearch database, \nconsider using a protocol and extending the Boundary record. \nThis will allow you to easily mock or stub out the database \nusing a tool like [Shrubbery][].\n\nA `:logger` key may also be specified, which will be used to log when\nthe module connects to or disconnects from ElasticSearch. \nThe value of the key should be an implementation of the \n`duct.logger/Logger` protocol from the [duct.logger][] library\n\n[shrubbery]: https://github.com/bguthrie/shrubbery\n[duct.logger]: https://github.com/duct-framework/logger\n\n## Connection settings\n\n### Client\n\n```edn\n{:duct.database.elasticsearch/spandex\n {:client {:hosts [\"127.0.0.1\" \"192.168.0.234\"]}}}\n```\n\n### Sniffer\n\n```edn\n{:duct.database.elasticsearch/spandex\n {:client {:hosts [\"127.0.0.1\" \"192.168.0.234\"]}}\n  :sniffer? true\n  :sniffer { ... }}\n```\n\nFor more information about Spandex client options you can see their\n[client documentation](https://mpenet.github.io/spandex/qbits.spandex.html#var-client)\nand [sniffer documentation](https://mpenet.github.io/spandex/qbits.spandex.html#var-sniffer)\n\n## Example\n\nThe ES REST client can be extracted from this module Boundary by using the `:client` key.\n\n```clojure\n(ns my-project.boundary.entry-db\n  (:require [duct.database.elasticsearch.spandex]\n            [qbits.spandex :as s]))\n            \n(defprotocol EntryDatabase\n  (search [db]))\n  \n(extend-protocol EntryDatabase\n  duct.database.elasticsearch.spandex.Boundary\n  (search [{:keys [client]}]\n    (s/request client {:url \"/entries/entry/_search\"\n                       :method :get\n                       :body {:query {:match_all {}}}})))\n```\n\n## License\n\nCopyright © 2018 Alexandre Grison\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrison%2Fduct-elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrison%2Fduct-elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrison%2Fduct-elasticsearch/lists"}