{"id":22354358,"url":"https://github.com/jonmagic/elasticsearch-client","last_synced_at":"2026-02-27T22:11:53.970Z","repository":{"id":2643880,"uuid":"3633414","full_name":"jonmagic/elasticsearch-client","owner":"jonmagic","description":null,"archived":false,"fork":false,"pushed_at":"2012-12-31T02:03:03.000Z","size":115,"stargazers_count":21,"open_issues_count":2,"forks_count":16,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-30T09:58:34.581Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonmagic.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":"2012-03-06T01:27:37.000Z","updated_at":"2024-10-13T20:23:18.000Z","dependencies_parsed_at":"2022-07-15T14:47:29.632Z","dependency_job_id":null,"html_url":"https://github.com/jonmagic/elasticsearch-client","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jonmagic/elasticsearch-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Felasticsearch-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Felasticsearch-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Felasticsearch-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Felasticsearch-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonmagic","download_url":"https://codeload.github.com/jonmagic/elasticsearch-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Felasticsearch-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273666012,"owners_count":25146275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-12-04T13:12:25.727Z","updated_at":"2026-02-27T22:11:48.950Z","avatar_url":"https://github.com/jonmagic.png","language":"Ruby","readme":"# ElasticSearch ruby client\n\nElasticSearch ruby client. Credit goes to my coworkers at GitHub, I just turned it into a gem.\n\n## Usage\n\nAdd to Gemfile\n\n```ruby\ngem 'elasticsearch-client', :require =\u003e 'elasticsearch'\n```\n\nCreate connection:\n\n```ruby\nindex = 'twitter'\nurl = 'http://localhost:9200'\nes = ElasticSearch::Index.new(index, url)\n```\n\nIndex a document:\n\n```ruby\ntype = 'tweet'\ndoc = {:id =\u003e 'abcd', :foo =\u003e 'bar'}\nes.add(type, doc[:id], doc)\n```\n\nGet a document:\n\n```ruby\nid = '1234'\nes.mget(type, [id])\n```\n\nGet documents:\n\n```ruby\nid2 = 'abcd'\nes.mget(type, [id, id2])\n```\n\nSearch:\n\n```ruby\nquery = {\n  :query =\u003e {\n    :bool =\u003e {\n      :must =\u003e {\n        :query_string =\u003e {\n          :default_field =\u003e '_all',\n          :query =\u003e 'foobar!',\n        }\n      }\n    }\n  }\n}\nes.search(type, query)\n```\n\nRemove record:\n\n```ruby\nes.remove(type, id)\n```\n\nRemove by query:\n\n```ruby\nes.remove_by_query(type, :term =\u003e {:foo =\u003e 'bar'})\n```\n\nRemove all of type:\n\n```ruby\nes.remove_all(type)\n```\n\n## Note on Patches/Pull Requests\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so we don't break it in a future version unintentionally.\n* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine, but bump version in a commit by itself so we can ignore when we pull)\n* Send us a pull request. Bonus points for topic branches.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonmagic%2Felasticsearch-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonmagic%2Felasticsearch-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonmagic%2Felasticsearch-client/lists"}