{"id":15671595,"url":"https://github.com/jeroen-g/explorer","last_synced_at":"2025-05-14T12:07:58.132Z","repository":{"id":37427247,"uuid":"306760996","full_name":"Jeroen-G/Explorer","owner":"Jeroen-G","description":"🗺️ Next-gen Elasticsearch driver for Laravel Scout.","archived":false,"fork":false,"pushed_at":"2025-03-28T08:22:17.000Z","size":560,"stargazers_count":381,"open_issues_count":25,"forks_count":65,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-11T04:58:16.244Z","etag":null,"topics":["elasticsearch","hacktoberfest","laravel"],"latest_commit_sha":null,"homepage":"https://jeroen-g.github.io/Explorer/","language":"PHP","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/Jeroen-G.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-23T22:35:32.000Z","updated_at":"2025-03-31T10:44:50.000Z","dependencies_parsed_at":"2023-12-14T12:44:03.224Z","dependency_job_id":"ac8d8147-f511-49e7-a676-c8c019b61135","html_url":"https://github.com/Jeroen-G/Explorer","commit_stats":{"total_commits":326,"total_committers":32,"mean_commits":10.1875,"dds":"0.45398773006134974","last_synced_commit":"2fd73a6147d841c332f0dc01efbcf1afe568bdb2"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeroen-G%2FExplorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeroen-G%2FExplorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeroen-G%2FExplorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeroen-G%2FExplorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jeroen-G","download_url":"https://codeload.github.com/Jeroen-G/Explorer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345273,"owners_count":21088244,"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":["elasticsearch","hacktoberfest","laravel"],"created_at":"2024-10-03T15:03:54.703Z","updated_at":"2025-04-11T04:58:22.521Z","avatar_url":"https://github.com/Jeroen-G.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Explorer\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n\n[![CI](https://github.com/Jeroen-G/Explorer/actions/workflows/ci.yml/badge.svg)](https://github.com/Jeroen-G/Explorer/actions/workflows/ci.yml)\n\nNext-gen Elasticsearch driver for Laravel Scout with the power of Elasticsearch's queries.\n\n## Installation\n\nVia Composer\n\n``` bash\ncomposer require jeroen-g/explorer\n```\n\nYou will need the configuration file to define your indexes:\n\n```bash\nphp artisan vendor:publish --tag=explorer.config\n```\n\nAlso do not forget to follow the [installation instructions for Laravel Scout](https://laravel.com/docs/scout#installation),\nand in your Laravel Scout config, set the driver to `elastic`. \n\n## Usage\n\nBe sure to also have a look at the [docs](docs/index.md) to see what is possible!\nThere is also a [demo app](https://github.com/Jeroen-G/explorer-demo) available that might be insightful.\n\n### Configuration\n\nYou may either define the mapping for you index in the config file:\n\n```php\nreturn [\n    'indexes' =\u003e [\n        'posts_index' =\u003e [\n            'properties' =\u003e [\n                'id' =\u003e 'keyword',\n                'title' =\u003e 'text',\n            ],\n        ]\n    ]\n];\n```\n\nOr you may define the model for the index, and the rest will be decided for you:\n\n```php\nreturn [\n    'indexes' =\u003e [\n        \\App\\Models\\Post::class\n    ],\n];\n```\n\nIn the last case you may implement the `Explored` interface and overwrite the mapping with the `mappableAs()` function.\n\nEssentially this means that it is up to you whether you like having it all together in the model, or separately in the config file.\n\n### Advanced queries\nThe documentation of Laravel Scout states that \"more advanced \"where\" clauses are not currently supported\".\nOnly a simple check for ID is possible besides the standard fuzzy term search:\n\n```php\n$posts = Post::search('lorem ipsum')-\u003eget();\n```\n\nExplorer expands your possibilities using query builders to write more complex queries.\n\nFor example, to get all posts that:\n\n - are published\n - have \"lorem\" somewhere in the document\n - have \"ipsum\" in the title\n - maybe have a tag \"featured\", if so boost its score by 2\n \n You could execute this search query:\n\n```php\n$posts = Post::search('lorem')\n    -\u003emust(new Matching('title', 'ipsum'))\n    -\u003eshould(new Terms('tags', ['featured'], 2))\n    -\u003efilter(new Term('published', true))\n    -\u003eget();\n```\n\n### Commands\nBe sure you have configured your indexes first in `config/explorer.php` and run the Scout commands.\n\n#### Searching indexes\n\n```bash\nphp artisan elastic:search \"App\\Models\\Post\" lorem\n```\n\n## Changelog\n\nPlease see the [changelog](changelog.md) for more information on what has changed recently.\n\n## Credits\n\n- [Jeroen][link-author-jeroen]\n- [Vincent][link-author-vincent]\n- [All Contributors][link-contributors]\n\n## License\n\nMIT. Please see the [license file](license.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/jeroen-g/explorer.svg?style=flat-square\n[ico-actions]: https://img.shields.io/github/workflow/status/Jeroen-G/explorer/CI?label=CI%2FCD\u0026style=flat-square\n\n[link-actions]: https://github.com/Jeroen-G/explorer/actions?query=workflow:CI\n[link-packagist]: https://packagist.org/packages/jeroen-g/explorer\n[link-author-jeroen]: https://github.com/jeroen-g\n[link-author-vincent]: https://github.com/blackshadev\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeroen-g%2Fexplorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeroen-g%2Fexplorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeroen-g%2Fexplorer/lists"}