{"id":13721485,"url":"https://github.com/meilisearch/meilisearch-ruby","last_synced_at":"2025-05-07T13:32:58.274Z","repository":{"id":36274727,"uuid":"222446809","full_name":"meilisearch/meilisearch-ruby","owner":"meilisearch","description":"Ruby SDK for the Meilisearch API","archived":false,"fork":false,"pushed_at":"2025-04-28T20:46:22.000Z","size":1338,"stargazers_count":210,"open_issues_count":17,"forks_count":48,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-04T04:09:36.955Z","etag":null,"topics":["client","meilisearch","sdk"],"latest_commit_sha":null,"homepage":"https://meilisearch.com","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/meilisearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-18T12:42:49.000Z","updated_at":"2025-04-28T20:46:26.000Z","dependencies_parsed_at":"2024-03-19T14:59:33.518Z","dependency_job_id":"12244c87-d199-4a3f-9f7f-a6e70036c48d","html_url":"https://github.com/meilisearch/meilisearch-ruby","commit_stats":{"total_commits":598,"total_committers":38,"mean_commits":"15.736842105263158","dds":0.657190635451505,"last_synced_commit":"cd0e9c660c4f3fa33950f2ebee879649758073b2"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meilisearch","download_url":"https://codeload.github.com/meilisearch/meilisearch-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252887014,"owners_count":21819829,"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":["client","meilisearch","sdk"],"created_at":"2024-08-03T01:01:17.669Z","updated_at":"2025-05-07T13:32:58.267Z","avatar_url":"https://github.com/meilisearch.png","language":"Ruby","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/meilisearch/integration-guides/main/assets/logos/meilisearch_ruby.svg\" alt=\"Meilisearch-Ruby\" width=\"200\" height=\"200\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eMeilisearch Ruby\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch\"\u003eMeilisearch\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/cloud?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-ruby\"\u003eMeilisearch Cloud\u003c/a\u003e |\n  \u003ca href=\"https://docs.meilisearch.com\"\u003eDocumentation\u003c/a\u003e |\n  \u003ca href=\"https://discord.meilisearch.com\"\u003eDiscord\u003c/a\u003e |\n  \u003ca href=\"https://roadmap.meilisearch.com/tabs/1-under-consideration\"\u003eRoadmap\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com\"\u003eWebsite\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/docs/faq\"\u003eFAQ\u003c/a\u003e\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://badge.fury.io/rb/meilisearch\"\u003e\u003cimg src=\"https://badge.fury.io/rb/meilisearch.svg\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch-ruby/actions\"\u003e\u003cimg src=\"https://github.com/meilisearch/meilisearch-ruby/workflows/Tests/badge.svg\" alt=\"Test\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://app.codecov.io/gh/meilisearch/meilisearch-ruby/tree/main\" \u003e\n    \u003cimg src=\"https://codecov.io/gh/meilisearch/meilisearch-ruby/branch/main/graph/badge.svg?token=9J7LRP11IR\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch-ruby/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-informational\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://ms-bors.herokuapp.com/repositories/6\"\u003e\u003cimg src=\"https://bors.tech/images/badge_small.svg\" alt=\"Bors enabled\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e⚡ The Meilisearch API client written for Ruby 💎\u003c/p\u003e\n\n**Meilisearch Ruby** is the Meilisearch API client for Ruby developers.\n\n**Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch)\n\n## Table of Contents \u003c!-- omit in TOC --\u003e\n\n- [📖 Documentation](#-documentation)\n- [🔧 Installation](#-installation)\n- [🚀 Getting started](#-getting-started)\n- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)\n- [💡 Learn more](#-learn-more)\n- [⚙️ Contributing](#️-contributing)\n\n## 📖 Documentation\n\nThis readme contains all the documentation you need to start using this Meilisearch SDK.\n\nFor general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our [main documentation website](https://www.meilisearch.com/docs/).\n\n\n## 🔧 Installation\n\nWe officially support any version of Ruby that is still receiving at least [security maintenance](https://www.ruby-lang.org/en/downloads/branches/). You may, however, be fine with any Ruby version above 3.0.\nHowever, we cannot guarantee support if your version is no longer being maintained.\n\nWith `gem` in command line:\n```bash\ngem install meilisearch\n```\n\nIn your `Gemfile` with [bundler](https://bundler.io/):\n```ruby\nsource 'https://rubygems.org'\n\ngem 'meilisearch'\n```\n\n### Run Meilisearch \u003c!-- omit in toc --\u003e\n\n⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no maintenance, no commitment, cancel anytime. [Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-ruby).\n\n🪨  Prefer to self-host? [Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-ruby) our fast, open-source search engine on your own infrastructure.\n\n## 🚀 Getting started\n\n#### Add documents \u003c!-- omit in toc --\u003e\n\n```ruby\nrequire 'meilisearch'\n\nclient = Meilisearch::Client.new('http://127.0.0.1:7700', 'masterKey')\n\n# An index is where the documents are stored.\nindex = client.index('movies')\n\ndocuments = [\n  { id: 1, title: 'Carol', genres: ['Romance', 'Drama'] },\n  { id: 2, title: 'Wonder Woman', genres: ['Action', 'Adventure'] },\n  { id: 3, title: 'Life of Pi', genres: ['Adventure', 'Drama'] },\n  { id: 4, title: 'Mad Max: Fury Road', genres: ['Adventure', 'Science Fiction'] },\n  { id: 5, title: 'Moana', genres: ['Fantasy', 'Action']},\n  { id: 6, title: 'Philadelphia', genres: ['Drama'] },\n]\n# If the index 'movies' does not exist, Meilisearch creates it when you first add the documents.\nindex.add_documents(documents) # =\u003e { \"uid\": 0 }\n```\n\nWith the `uid`, you can check the status (`enqueued`, `canceled`, `processing`, `succeeded` or `failed`) of your documents addition using the [task](https://www.meilisearch.com/docs/reference/api/tasks#get-tasks).\n\n💡 To customize the `Client`, for example, increasing the default timeout, please check out [this section](https://github.com/meilisearch/meilisearch-ruby/wiki/Client-Options) of the Wiki.\n\n#### Basic Search \u003c!-- omit in toc --\u003e\n\n``` ruby\n# Meilisearch is typo-tolerant:\nputs index.search('carlo')\n```\nOutput:\n\n```ruby\n{\n  \"hits\" =\u003e [{\n    \"id\" =\u003e 1,\n    \"title\" =\u003e \"Carol\"\n  }],\n  \"offset\" =\u003e 0,\n  \"limit\" =\u003e 20,\n  \"processingTimeMs\" =\u003e 1,\n  \"query\" =\u003e \"carlo\"\n}\n```\n\n#### Custom search \u003c!-- omit in toc --\u003e\n\nAll the supported options are described in the [search parameters](https://www.meilisearch.com/docs/reference/api/search#search-parameters) section of the documentation.\n\n```ruby\nindex.search(\n  'wonder',\n  attributes_to_highlight: ['*']\n)\n```\n\nJSON output:\n\n```json\n{\n    \"hits\": [\n        {\n            \"id\": 2,\n            \"title\": \"Wonder Woman\",\n            \"_formatted\": {\n                \"id\": 2,\n                \"title\": \"\u003cem\u003eWonder\u003c/em\u003e Woman\"\n            }\n        }\n    ],\n    \"offset\": 0,\n    \"limit\": 20,\n    \"processingTimeMs\": 0,\n    \"query\": \"wonder\"\n}\n```\n\n#### Custom Search With Filters \u003c!-- omit in toc --\u003e\n\nIf you want to enable filtering, you must add your attributes to the `filterableAttributes` index setting.\n\n```ruby\nindex.update_filterable_attributes([\n  'id',\n  'genres'\n])\n```\n\nYou only need to perform this operation once.\n\nNote that Meilisearch will rebuild your index whenever you update `filterableAttributes`. Depending on the size of your dataset, this might take time. You can track the process using the [tasks](https://www.meilisearch.com/docs/reference/api/tasks#get-tasks)).\n\nThen, you can perform the search:\n\n```ruby\nindex.search('wonder', { filter: ['id \u003e 1 AND genres = Action'] })\n```\n\nJSON output:\n\n```json\n{\n  \"hits\": [\n    {\n      \"id\": 2,\n      \"title\": \"Wonder Woman\",\n      \"genres\": [\n        \"Action\",\n        \"Adventure\"\n      ]\n    }\n  ],\n  \"estimatedTotalHits\": 1,\n  \"query\": \"wonder\",\n  \"limit\": 20,\n  \"offset\": 0,\n  \"processingTimeMs\": 0\n}\n```\n\n#### Display ranking details at search\n\nJSON output:\n\n```json\n{\n  \"hits\": [\n    {\n      \"id\": 15359,\n      \"title\": \"Wonder Woman\",\n      \"_rankingScoreDetails\": {\n        \"words\": {\n          \"order\": 0,\n          \"matchingWords\": 2,\n          \"maxMatchingWords\": 2,\n          \"score\": 1.0\n        },\n        \"typo\": {\n          \"order\": 1,\n          \"typoCount\": 0,\n          \"maxTypoCount\": 2,\n          \"score\": 1.0\n        },\n        \"proximity\": {\n          \"order\": 2,\n          \"score\": 1.0\n        },\n        \"attribute\": {\n          \"order\": 3,\n          \"attributeRankingOrderScore\": 0.8181818181818182,\n          \"queryWordDistanceScore\": 1.0,\n          \"score\": 0.8181818181818182\n        },\n        \"exactness\": {\n          \"order\": 4,\n          \"matchType\": \"exactMatch\",\n          \"score\": 1.0\n        }\n      }\n    }\n  ]\n}\n```\n\nThis feature is only available with Meilisearch v1.3 and newer (optional).\n\n#### Custom Search With attributes on at search time  \u003c!-- omit in toc --\u003e\n\n[Customize attributes to search on at search time](https://www.meilisearch.com/docs/reference/api/search#customize-attributes-to-search-on-at-search-time).\n\nyou can perform the search :\n\n```ruby\nindex.search('wonder', { attributes_to_search_on: ['genres'] })\n```\n\n\nJSON output:\n\n```json\n{\n  \"hits\":[],\n  \"query\":\"wonder\",\n  \"processingTimeMs\":0,\n  \"limit\":20,\n  \"offset\":0,\n  \"estimatedTotalHits\":0,\n  \"nbHits\":0\n}\n```\n\nThis feature is only available with Meilisearch v1.3 and newer (optional).\n\n\n## 🤖 Compatibility with Meilisearch\n\nThis package guarantees compatibility with [version v1.x of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/meilisearch-ruby/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info.\n\n## 💡 Learn more\n\nThe following sections in our main documentation website may interest you:\n\n- **Manipulate documents**: see the [API references](https://www.meilisearch.com/docs/reference/api/documents) or read more about [documents](https://www.meilisearch.com/docs/learn/core_concepts/documents).\n- **Search**: see the [API references](https://www.meilisearch.com/docs/reference/api/search) or follow our guide on [search parameters](https://www.meilisearch.com/docs/reference/api/search#search-parameters).\n- **Manage the indexes**: see the [API references](https://www.meilisearch.com/docs/reference/api/indexes) or read more about [indexes](https://www.meilisearch.com/docs/learn/core_concepts/indexes).\n- **Configure the index settings**: see the [API references](https://www.meilisearch.com/docs/reference/api/settings) or follow our guide on [settings parameters](https://www.meilisearch.com/docs/reference/api/settings).\n\n📖 Also, check out the [Wiki](https://github.com/meilisearch/meilisearch-ruby/wiki) of this repository to know what this SDK provides!\n\n## ⚙️ Contributing\n\nAny new contribution is more than welcome in this project!\n\nIf you want to know more about the development workflow or want to contribute, please visit our [contributing guidelines](/CONTRIBUTING.md) for detailed instructions!\n\n\u003chr\u003e\n\n**Meilisearch** provides and maintains many **SDKs and Integration tools** like this one. We want to provide everyone with an **amazing search experience for any kind of project**. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the [integration-guides](https://github.com/meilisearch/integration-guides) repository.\n","funding_links":[],"categories":["Ruby","Integrations"],"sub_categories":["Official Integrations"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilisearch%2Fmeilisearch-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeilisearch%2Fmeilisearch-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilisearch%2Fmeilisearch-ruby/lists"}