{"id":15151853,"url":"https://github.com/elastic/workplace-search-ruby","last_synced_at":"2025-09-29T21:31:23.484Z","repository":{"id":59156998,"uuid":"95806298","full_name":"elastic/workplace-search-ruby","owner":"elastic","description":"Elastic Workplace Search Official Ruby Client","archived":true,"fork":false,"pushed_at":"2020-11-17T14:21:32.000Z","size":264,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-09-22T23:03:05.103Z","etag":null,"topics":["api-client","elastic","elastic-enterprise-search","elastic-workplace-search","ruby","ruby-client","search","swiftype"],"latest_commit_sha":null,"homepage":"https://www.elastic.co/workplace-search","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elastic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-29T18:14:25.000Z","updated_at":"2024-01-31T11:36:02.000Z","dependencies_parsed_at":"2022-09-13T20:03:32.366Z","dependency_job_id":null,"html_url":"https://github.com/elastic/workplace-search-ruby","commit_stats":null,"previous_names":["swiftype/swiftype-enterprise-ruby"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fworkplace-search-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fworkplace-search-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fworkplace-search-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fworkplace-search-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastic","download_url":"https://codeload.github.com/elastic/workplace-search-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219874704,"owners_count":16554609,"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","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":["api-client","elastic","elastic-enterprise-search","elastic-workplace-search","ruby","ruby-client","search","swiftype"],"created_at":"2024-09-26T15:23:08.212Z","updated_at":"2025-09-29T21:31:18.161Z","avatar_url":"https://github.com/elastic.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **⚠️ This client is deprecated ⚠️**\n\u003e\n\u003e As of Enterprise Search version 7.10.0, we are directing users to the new [Enterprise Search Ruby Client](https://github.com/elastic/enterprise-search-ruby) and\n\u003e deprecating this client.\n\u003e\n\u003e This client will be compatible with all Enterprise Search 7.x releases, but will not be compatible with 8.x releases. Our development effort on this project will\n\u003e be limited to bug fixes. All future enhancements will be focused on the Enterprise Search Ruby Client.\n\u003e\n\u003e Thank you! - Elastic\n\n[![Master build](https://github.com/elastic/workplace-search-ruby/workflows/master/badge.svg)](https://github.com/elastic/workplace-search-ruby/actions?query=workflow%3Amaster)\n\n\n\u003e A first-party Ruby client for [Elastic Workplace Search](https://www.elastic.co/workplace-search).\n\n## Contents\n\n+ [Getting started](#getting-started-)\n+ [Usage](#usage)\n+ [FAQ](#faq-)\n+ [Contribute](#contribute-)\n+ [License](#license-)\n\n***\n\n## Getting started 🐣\n\nTo install the gem, execute:\n\n```bash\ngem install elastic-workplace-search\n```\n\nOr place `gem 'elastic-workplace-search', '~\u003e 0.4.1` in your `Gemfile` and run `bundle install`.\n\n## Usage\n\nIn your Elastic Workplace Search dashboard navigate to Sources/Add a Shared Content Source/Custom API Source to create a new source. Name your source (e.g. `Workplace Search Ruby Client`) and once it's created you'll get an `access token` and a `key`. You'll need these in the following steps.\n\nCreate a new instance of the Elastic Workplace Search client with your access token:\n\n```ruby\nElastic::WorkplaceSearch.access_token = '' # your access token\nclient = Elastic::WorkplaceSearch::Client.new\n```\n\n### Change API endpoint\n\n```ruby\nclient = Elastic::WorkplaceSearch::Client.new\nElastic::WorkplaceSearch.endpoint = 'https://your-server.example.com/api/ws/v1'\n```\n\n### Specifying an HTTP Proxy\n\n```ruby\nclient = Elastic::WorkplaceSearch::Client.new(proxy: 'http://localhost:8888')\n```\n\n### Documents\n\n#### Indexing Documents\n\nThis example shows how to use the index_documents method:\n\n```ruby\ncontent_source_key = '' # your content source key\ndocuments = [\n  {\n    'id' =\u003e 'INscMGmhmX4',\n    'url' =\u003e 'http://www.youtube.com/watch?v=v1uyQZNg2vE',\n    'title' =\u003e 'The Original Grumpy Cat',\n    'body' =\u003e 'this is a test'\n  },\n  {\n    'id' =\u003e 'JNDFojsd02',\n    'url' =\u003e 'http://www.youtube.com/watch?v=tsdfhk2j',\n    'title' =\u003e 'Another Grumpy Cat',\n    'body' =\u003e 'this is also a test'\n  }\n]\n\nbegin\n  document_receipts = client.index_documents(content_source_key, documents)\n  # handle results\nrescue Elastic::WorkplaceSearch::ClientException =\u003e e\n  # handle error\nend\n```\n\n#### Destroying Documents\n\n```ruby\ncontent_source_key = '' # your content source key\ndocument_ids = ['INscMGmhmX4', 'JNDFojsd02']\n\nbegin\n  destroy_document_results = client.destroy_documents(content_source_key, document_ids)\n  # handle destroy document results\nrescue Elastic::WorkplaceSearch::ClientException =\u003e e\n  # handle error\nend\n```\n\n### Permissions\n\n#### Listing all permissions\n\n```ruby\ncontent_source_key = '' # your content source key\n\nclient.list_all_permissions(content_source_key)\n```\n\n#### Listing all permissions with paging\n\n```ruby\ncontent_source_key = '' # your content source key\n\nclient.list_all_permissions(content_source_key, current: 2, size: 20)\n```\n\n#### Retrieve a User's permissions\n\n```ruby\ncontent_source_key = '' # your content source key\nuser = 'enterprise_search'\n\nclient.get_user_permissions(content_source_key, user)\n```\n\n#### Add permissions to a User\n```ruby\ncontent_source_key = '' # your content source key\nuser = 'enterprise_search'\npermissions = ['permission1']\n\nclient.add_user_permissions(content_source_key, user, permissions: permissions)\n```\n\n#### Update a User's permissions\n```ruby\ncontent_source_key = '' # your content source key\nuser = 'enterprise_search'\npermissions = ['permission2']\n\nclient.update_user_permissions(content_source_key, user, permissions: permissions)\n```\n\n#### Remove permissions from a User\n```ruby\ncontent_source_key = '' # your content source key\nuser = 'enterprise_search'\npermissions = ['permission2']\n\nclient.remove_user_permissions(content_source_key, user, permissions: permissions)\n```\n\n## Running tests\n\nRun tests via rspec:\n\n```bash\n$ ENDPOINT=http://localhost:3002/api/ws/v1 bundle exec rspec\n```\n\n## FAQ 🔮\n\n### Where do I report issues with the client?\n\nIf something is not working as expected, please open an [issue](https://github.com/elastic/workplace-search-ruby/issues/new).\n\n## Contribute 🚀\n\nWe welcome contributors to the project. Before you begin, a couple notes...\n\n+ Before opening a pull request, please create an issue to [discuss the scope of your proposal](https://github.com/elastic/workplace-search-ruby/issues).\n+ Please write simple code and concise documentation, when appropriate.\n\n## License 📗\n\n[Apache 2.0](https://github.com/elastic/workplace-search-ruby/blob/master/LICENSE.txt) © [Elastic](https://github.com/elastic)\n\nThank you to all the [contributors](https://github.com/elastic/workplace-search-ruby/graphs/contributors)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fworkplace-search-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastic%2Fworkplace-search-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fworkplace-search-ruby/lists"}