{"id":22364120,"url":"https://github.com/11ways/alchemy-search","last_synced_at":"2026-07-04T10:31:22.029Z","repository":{"id":57175511,"uuid":"97030294","full_name":"11ways/alchemy-search","owner":"11ways","description":"Search behaviours for Alchemy","archived":false,"fork":false,"pushed_at":"2020-02-17T12:56:42.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-29T01:56:37.726Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/11ways.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-12T16:36:01.000Z","updated_at":"2020-07-26T11:08:45.000Z","dependencies_parsed_at":"2022-08-29T00:11:09.234Z","dependency_job_id":null,"html_url":"https://github.com/11ways/alchemy-search","commit_stats":null,"previous_names":["skerit/alchemy-search"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/11ways/alchemy-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/11ways%2Falchemy-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/11ways%2Falchemy-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/11ways%2Falchemy-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/11ways%2Falchemy-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/11ways","download_url":"https://codeload.github.com/11ways/alchemy-search/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/11ways%2Falchemy-search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35118970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"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-04T17:18:35.560Z","updated_at":"2026-07-04T10:31:22.009Z","avatar_url":"https://github.com/11ways.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alchemy Search\n\nThe search plugin for the Alchemy MVC\n\n## Installation\n\nJust installing the npm package can be done like this:\n\n    $ npm install alchemy-search\n\n## Activate\n\nYou can activate the plugin by adding this to the main `bootstrap.js` file:\n\n```javascript\nalchemy.usePlugin('search', {});\n```\n\n## Use\n\nThis plugin gives you a new behaviour `search` to add to your models,\nyou can do this after constituting your model.\n\nYou have to supply an options object when adding the behaviour.\nHere you need to add the fields you want to make searchable and the importance of those fields.\n\n```javascript\nMyModel.constitute(function addFields() {\n\n    // Add your fields like you normally would\n    this.addField('name', 'String');\n    this.addField('title', 'String', {translatable: true});\n    this.addField('description', 'String', {translatable: true});\n\n    // And finally add the search behaviour\n    this.addBehaviour('search', {\n        fields: {\n            title       : 50,\n            name        : 30,\n            description : 10\n        }\n    });\n});\n```\n\nNow, after a record of (in this example) `MyModel` has been saved, the search behaviour will create the required data in the database.\n\nA new method has been added to the `Model` class: `touchAll(callback)`. It basically re-saves all the records in a model (without setting the `updated` date) and triggering the before- and after-save events.\n\nFinally, you can search through the model like so:\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F11ways%2Falchemy-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F11ways%2Falchemy-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F11ways%2Falchemy-search/lists"}