{"id":18620845,"url":"https://github.com/exts/crolia","last_synced_at":"2025-11-03T12:30:27.514Z","repository":{"id":114940298,"uuid":"88888335","full_name":"exts/Crolia","owner":"exts","description":"Algolia.com api wrapper library written in crystal","archived":false,"fork":false,"pushed_at":"2017-04-22T12:56:26.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T04:26:25.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exts.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-20T16:40:02.000Z","updated_at":"2017-04-20T16:43:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f45cc88-8ac2-46e2-ab2b-48d1a828c403","html_url":"https://github.com/exts/Crolia","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exts%2FCrolia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exts%2FCrolia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exts%2FCrolia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exts%2FCrolia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exts","download_url":"https://codeload.github.com/exts/Crolia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239414236,"owners_count":19634398,"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":[],"created_at":"2024-11-07T04:08:12.511Z","updated_at":"2025-11-03T12:30:27.466Z","avatar_url":"https://github.com/exts.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crolia\n\nCrolia is a wrapper around [Algolia.com's](http://algolia.com) api allowing you to use most of their REST api features from inserting/deleting/updating and searching data.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  Crolia:\n    github: exts/Crolia\n```\n\n## Done\n- List indices\n- Search an index\n- Search an index (alternative)\n- Search multiple indices\n- Delete an index\n- Clear an index\n- Add an object without ID\n- Add/update an object by ID\n- Partially update an object\n- Retrieve an object\n- Retrieve multiple objects\n- Delete an object\n\n## TODO\n- Batch write operations\n- Batch write operations (multiple indices)\n- Browse all index content\n- Browse all index content (alternative)\n- Get index settings\n- Change index settings\n- Copy/move an index\n- Get a task’s status\n- Add an index-specific API key\n- Update an index-specific API key\n- List index-specific API keys\n- List index-specific API keys (for all indices)\n- Retrieve an index-specific API key\n- Delete an index-specific API key\n- Search for facet values\n\n## Usage\n\n### Connecting to api\n\n```crystal\nrequire \"Crolia\"\n\napi = Crolia::Api.new \"API_KEY\", \"API_ID\"\n```\n\n###### Search Index by keyword\n```crystal\nindex = api.index \"example_index\"\nresults = index.find_by \"example_search_term\"\nputs results.data # returns algolia response message/results\n```\n\n###### Search multiple indices by keywords\n```crystal\nindex = api.index \"example_index\"\nresults = index.find_multiple([\n    {\"params\" =\u003e \"query=data\"}\n])\nputs results.data # returns algolia response message/results\n```\n\n###### List all Indexes\n```crystal\nindex = api.index \"example_index\"\nresults = index.find_all\nputs results.data\n```\n\n###### Find object by id\n```crystal\nobject = api.objects \"example_index\"\nresults = object.find(\"1\") # you can pass attributes as the 2nd parameter using a Hash(String, String)\nputs results.data\n```\n\n###### Find multiple objects\n```crystal\nobject = api.objects \"example_index\"\nresults = object.find_all([\n    {\"objectID\" =\u003e \"1\"},\n    {\"objectID\" =\u003e \"2\"},\n])\nputs results.data\n```\n\n###### Insert or Update an object\n```crystal\nobject = api.objects \"example_index\"\n\n# first paramter just pass a has and convert it to json using .to_json, 2nd parameter is optional it's he id, if you leave it blank it'll create an objectId for you\nresults = object.add_or_update({\"title\" =\u003e \"Custom Title\", \"tags\" =\u003e [\"custom_tag_1\", \"custom_tag_2\"]}.to_json, \"3\")\nputs results.data\n```\n\n###### Partial Update an object\n```crystal\nobject = api.objects \"example_index\"\n\n# first parameter is the id you want to pass, 2nd parameter is the data you want to partially update (convert to json) \n# and the last field that's optional is a boolean which forces the creating of the object if it doesn't exist, disabled by default\nobject.partial_update(\"5\", {\"title\" =\u003e \"Updated Title\", \"shouldnt_get_created\" =\u003e true}.to_json)\nputs results.data\n```\n\n###### Delete an object\n```crystal\nobject = api.objects \"example_index\"\n\n# as simple as passing the object id to be deleted\nobjects.delete(\"4\")\n\nputs results.data\n```\n\n## Contributors\n\n- [[exts]](https://github.com/exts) exts - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexts%2Fcrolia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexts%2Fcrolia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexts%2Fcrolia/lists"}