{"id":28433171,"url":"https://github.com/brokerexchange/elasticscout","last_synced_at":"2025-06-24T04:09:37.277Z","repository":{"id":62497394,"uuid":"72741791","full_name":"BrokerExchange/ElasticScout","owner":"BrokerExchange","description":"Laravel Scout Driver for Elasticsearch","archived":false,"fork":false,"pushed_at":"2025-01-08T22:24:37.000Z","size":102,"stargazers_count":17,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"10.0","last_synced_at":"2025-06-24T04:09:35.477Z","etag":null,"topics":["elasticsearch","elasticsearch-query-dsl","laravel-scout","php","query-builder"],"latest_commit_sha":null,"homepage":"","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/BrokerExchange.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}},"created_at":"2016-11-03T12:11:11.000Z","updated_at":"2022-03-10T15:37:54.000Z","dependencies_parsed_at":"2022-11-02T11:32:51.382Z","dependency_job_id":null,"html_url":"https://github.com/BrokerExchange/ElasticScout","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/BrokerExchange/ElasticScout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokerExchange%2FElasticScout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokerExchange%2FElasticScout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokerExchange%2FElasticScout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokerExchange%2FElasticScout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrokerExchange","download_url":"https://codeload.github.com/BrokerExchange/ElasticScout/tar.gz/refs/heads/10.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokerExchange%2FElasticScout/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261601527,"owners_count":23183097,"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","elasticsearch-query-dsl","laravel-scout","php","query-builder"],"created_at":"2025-06-05T18:08:25.476Z","updated_at":"2025-06-24T04:09:37.264Z","avatar_url":"https://github.com/BrokerExchange.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/brokerexchange/elasticscout/v/stable)](https://packagist.org/packages/brokerexchange/elasticscout)\n[![Latest Unstable Version](https://poser.pugx.org/brokerexchange/elasticscout/v/unstable)](https://packagist.org/packages/brokerexchange/elasticscout)\n[![Total Downloads](https://poser.pugx.org/brokerexchange/elasticscout/downloads)](https://packagist.org/packages/brokerexchange/elasticscout)\n[![License](https://poser.pugx.org/brokerexchange/elasticscout/license)](https://packagist.org/packages/brokerexchange/elasticscout)\n[![composer.lock](https://poser.pugx.org/brokerexchange/elasticscout/composerlock)](https://packagist.org/packages/brokerexchange/elasticscout)\n\n# ElasticScout\nA [Laravel Scout](https://github.com/laravel/scout) Driver for Elasticsearch 6\n\n## Overview\nElasticScout is a [Laravel Scout](https://github.com/laravel/scout) Elasticsearch 6 compatible engine. It makes critical changes to the old Elasticseach Scout Engine, as well as adds new functionality.\n\nThe ElasticScout engine includes an Elasticsearch Query Builder which can be used to create elaborate custom queries and aggregations, allowing full use of Elasticsearch within the Laravel/Scout Paradigm.\n\n## License\nElasticScout is released under the MIT Open Source License, \u003chttps://opensource.org/licenses/MIT\u003e\n\n## Copyright\nElasticScout \u0026copy; Broker Exchange Network 2018\n\n## Installation\n * Run composer require command\n `composer require brokerexchange/elasticscout`\n * Configure Elasticsearch Host (default: localhost:9200)\n ```env\n    ELASTICSEARCH_HOST='elastic1.host.com:9200,elastic2.host.com:9200'\n ```\n * Add trait to desired model\n ```php\n    use ElasticScout\\Searchable;\n ```\n \n## Usage\n ```php\n    //create search/query object\n    $search = $article-\u003esearch()\n        -\u003eboolean()\n        -\u003eshould(DSL::match('title',$request-\u003einput('query')))\n        -\u003eshould(DSL::match('body',$request-\u003einput('query')))\n        -\u003ehighlight(['body','title'])\n        -\u003efilter(DSL::term('published', 1))\n        -\u003eaggregate(Agg::terms('categories', 'category.name'));\n        \n    //fire the search\n    $articles = $search-\u003epaginate();\n        \n    //retrieve aggregation results\n    $categories = $search-\u003eaggregation('categories');\n    \n    //retrieve highlight results for title field of first result article\n    $firstArticleTitleHighlights = $articles-\u003efirst()-\u003ehighlight('title');\n    \n ```\n## Mappings\n You may set a custom mapping by simply defining a \"mapping\" method on your model.\n \n ```php\n    public function mappings()\n    {\n        return [\n            $this-\u003esearchableType() =\u003e [\n                'properties' =\u003e [\n                    'name' =\u003e [\n                        'type' =\u003e 'text',\n                        'fields' =\u003e [\n                            'keyword' =\u003e [\n                                'type' =\u003e 'keyword',\n                            ],\n                            'autocomplete' =\u003e [\n                                'type' =\u003e 'text',\n                                'analyzer' =\u003e 'autocomplete',\n                                'search_analyzer' =\u003e 'autocomplete_search',\n                            ],\n                        ],\n                    ],\n                ]\n            ]\n        ]\n    }\n ```\n \n ## Settings\n  You may create custom settings and analyzers by creating a \"settings\" method on the model.\n  \n ```php\n    public function settings()\n    {\n      return [\n          'index' =\u003e [\n              'analysis' =\u003e [\n                  'analyzer' =\u003e [\n                      'autocomplete' =\u003e [\n                          'tokenizer' =\u003e 'autocomplete',\n                          'filter' =\u003e [\n                              'lowercase',\n                          ],\n                      ],\n                      'autocomplete_search' =\u003e [\n                          'tokenizer' =\u003e 'lowercase',\n                      ],\n                  ],\n                  'tokenizer' =\u003e [\n                      'autocomplete' =\u003e [\n                          'type' =\u003e 'edge_ngram',\n                          'min_gram' =\u003e 1,\n                          'max_gram' =\u003e 15,\n                          'token_chars' =\u003e [\n                              'letter'\n                          ]\n                      ]\n                  ]\n              ],\n          ],\n      ];\n    }\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrokerexchange%2Felasticscout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrokerexchange%2Felasticscout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrokerexchange%2Felasticscout/lists"}