{"id":20196151,"url":"https://github.com/hellobetterltd/elemental-seach","last_synced_at":"2025-11-09T07:03:46.817Z","repository":{"id":32516397,"uuid":"135777543","full_name":"HelloBetterLTD/elemental-seach","owner":"HelloBetterLTD","description":"Fulltext Search for elemental blocks.","archived":false,"fork":false,"pushed_at":"2023-11-03T10:04:34.000Z","size":94,"stargazers_count":6,"open_issues_count":10,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T20:05:39.096Z","etag":null,"topics":["elemental","fulltext-search","silverstripe","silverstripe-elemental"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HelloBetterLTD.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}},"created_at":"2018-06-02T01:28:47.000Z","updated_at":"2024-02-26T08:34:15.000Z","dependencies_parsed_at":"2023-02-18T01:01:39.143Z","dependency_job_id":"eddfce2a-87c5-4d71-8a9b-2e7e0f50eef7","html_url":"https://github.com/HelloBetterLTD/elemental-seach","commit_stats":{"total_commits":54,"total_committers":7,"mean_commits":7.714285714285714,"dds":0.2222222222222222,"last_synced_commit":"cad24d6d7fc7f37d564dc51ca7b9794510f7a280"},"previous_names":["silverstripers/elemental-seach"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloBetterLTD%2Felemental-seach","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloBetterLTD%2Felemental-seach/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloBetterLTD%2Felemental-seach/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloBetterLTD%2Felemental-seach/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HelloBetterLTD","download_url":"https://codeload.github.com/HelloBetterLTD/elemental-seach/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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":["elemental","fulltext-search","silverstripe","silverstripe-elemental"],"created_at":"2024-11-14T04:22:03.376Z","updated_at":"2025-11-09T07:03:46.752Z","avatar_url":"https://github.com/HelloBetterLTD.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SilverStripe - Elemental search \n\n## Introduction\n\nThis module integrates [dnadesign/silverstripe-elemental](https://github.com/dnadesign/silverstripe-elemental)\ninto [SilverStripe's Fulltext search](https://docs.silverstripe.org/en/4/developer_guides/search/fulltextsearch/) \nand provides extensions to create search documents for your Pages or any data objects which you need to work with the full text search. The module comes in handy for systems where you dont want to make use of complex search systems like Solr. \n\n## Requirements\n\n* SilverStripe ^4.0\n* Elemental ^2.0\n\n## Installation\n\nInstall with Composer:\n\n```\ncomposer require silverstripers/elemental-search dev-master\n```\n\nEnsure you run `dev/build?flush=1` to build your database and flush your cache.\n\n## Usage\n\n### Enable Full text search \n\nThe module once installed elables Full text search by itself on the SearchDocument dataobject. There are no additional configs you want to use.\n\n### Create a search form \n\nCreate a search form with the code below and display on a template \n\n```\nuse SilverStripe\\CMS\\Search\\SearchForm;\n\n\nclass  MyController extends Controller {\n\n   public function SearchForm() \n   {\n      return SearchForm::create($this, 'SearchForm');\n   }\n   \n   public function results($data, $form, $request)\n    {\n        $data = array(\n            'Results' =\u003e $form-\u003egetResults(),\n            'Query' =\u003e DBField::create_field('Text', $form-\u003egetSearchQuery()),\n            'Title' =\u003e _t('SilverStripe\\\\CMS\\\\Search\\\\SearchForm.SearchResults', 'Search Results')\n        );\n        return $this-\u003eowner-\u003ecustomise($data)-\u003erenderWith(array('Page_results', 'Page'));\n    }\n\n}\n\n```\n\n### Include objects to search. \n\nAny data object you'd like to include in the search has to be decorated with the `SilverStripers\\ElementalSearch\\Extensions\\SearchDocumentGenerator`. After doing this this extension will make a search document each time when the data object is created, updated, and when deleted it will delete the search document. For Versioned data objects it will only create search documents when the object is published. \n\n### Specify which contents needs to be searched. \n\nFor the webpages you have the option to configure which dom elements to include in the search. Eg: You wont need it to cache the whole page and run search on certain info which duplicates over the site like the navigations. \n\n```\nSilverStripers\\ElementalSearch\\Model\\SearchDocument:\n    search_x_path:\n        - main-content\n```\n\nIn the situation where you have content outside of elemental elements that you want to include in the search.\n\n```\nSilverStripers\\ElementalSearch\\Model\\SearchDocument:\n    only_use_x_path: true\n```\n\nThe above settings will render the page and exract content within the `main-content` DOM node, and create the document. \n\n\n## How it works \n\nThe module adds a new DataObject `SearchDocument`. This gets created when each of the search enabled pages. And it is how it creates aggregated search results. \n\nThe module overrides the MySQLDatabase and the search result queries.\n\n## Reporting Issues\n\nPlease [create an issue](https://github.com/SilverStripers/elemental-seach/issues) for any bugs, or submit merge requests. \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellobetterltd%2Felemental-seach","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellobetterltd%2Felemental-seach","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellobetterltd%2Felemental-seach/lists"}