Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Explorer Laravel Package

jeroen-g/explorer

Laravel-friendly wrapper for Explorer, a lightweight full-text search engine. Index and search your Eloquent models with simple configuration, fast queries, and flexible ranking/filters. Ideal for adding on-site search without running Elasticsearch or Algolia.

View on GitHub
Deep Wiki
Context7

Connection

Explorer connects to ElasticSearch through the PHP ElasticSearch client and has several options to configure a connection. The connection configuration is defined config/explorer.php.

Basic

The most basic connection is with http without authorization.

    return [
        'connection' => [
            'host' => 'localhost',
            'port' => '9200',
            'scheme' => 'http',
        ],
    ];

Elastic Cloud ID

Another connection option is to use an elastic cloud id as shown below

    return [
        'connection' => [
            'elasticCloudId' => 'staging:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw',
        ],
    ];

Basic Authorization

To specify a username and password use the auth key with a username and a password.

    return [
        'connection' => [
            'host' => 'localhost',
            'port' => '9200',
            'scheme' => 'http',
            'auth' => [
                'username' => 'myName',
                'password' => 'myPassword'
            ],
        ],
    ];

API key

Replace the auth part with API and give it your key and id.

    return [
        'connection' => [
            'host' => 'localhost',
            'port' => '9200',
            'scheme' => 'http',
            'api' => [
                'id' => 'myId',
                'key' => 'myKey'
            ],
        ],
    ];

Verify TLS with CA

From Elastic 8 and upwards TLS is becoming the default, even in development. This means you will need to verify the CA. You can set the ssl.verify config key to the path of the CA, or to false to disable verification altogether.

Warning Disabling CA verification on production is not recommended.

    return [
        'connection' => [
            'host' => 'localhost',
            'port' => '9200',
            'scheme' => 'http',
            'ssl' => [
                'verify' => true,
                'key' => './path/to/ca.crt',
            ],
        ],
    ];

To disable TLS verification set it to false. NOT recommended for production.

    return [
        'connection' => [
            'host' => 'localhost',
            'port' => '9200',
            'scheme' => 'http',
            'ssl' => [
                'verify' => false,
            ],
        ],
    ];

TLS connection with a public certificate and private key

    return [
        'connection' => [
            'host' => 'localhost',
            'port' => '9200',
            'scheme' => 'https',
            'ssl' => [
                'cert' => ['path/to/cert.pem', 'passphrase'],
                'key' => ['path/to/key.pem', 'passphrase'],
            ],
        ],
    ];

Multiple connections

Elastic can also have multiple possible connections

    use Elastic\Transport\NodePool\Selector\RoundRobin;
    
    return [
        'connection' => [
            'host' => 'localhost',
            'port' => '9200',
            'scheme' => 'http',
            'ssl' => [
                'verify' => false,
            ],
            'selector' => RoundRobin::class
        ],
        'additionalConnections' => [
            [
                'host' => 'localhost',
                'port' => '9201',
                'scheme' => 'http',
            ],
            [
                'host' => 'localhost',
                'port' => '9202',
                'scheme' => 'http',
            ]
        ],
    ];
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests