Download the PHP package friendsofcat/opensearch-scout-driver without Composer

On this page you can find all versions of the php package friendsofcat/opensearch-scout-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package opensearch-scout-driver

OpenSearch Scout Driver

OpenSearch driver for Laravel Scout.

Contents

Compatibility

The current version of OpenSearch Scout Driver has been tested with the following configuration:

Installation

The library can be installed via Composer:

Note, that this library is just a driver for Laravel Scout, don't forget to install it beforehand:

After Scout has been installed, publish its configuration file using:

Then, change the driver option in the config/scout.php file to opensearch:

If you want to use OpenSearch Scout Driver with Lumen framework check this guide.

Configuration

OpenSearch Scout Driver uses friendsofcat/opensearch-client as a dependency. To change the client settings you need to publish the configuration file first:

In the newly created config/opensearch.client.php file you can define the default connection name using configuration hashes. Please, refer to the opensearch-client documentation for more details.

OpenSearch Scout Driver itself has only one configuration option at the moment - refresh_documents. If it's set to true (false by default) documents are indexed immediately, which might be handy for testing.

You can configure refresh_documents in the config/opensearch.scout_driver.php file after publishing it with the following command:

At last, do not forget, that with Scout you can configure the searchable data, the model id and the index name. Check the official Scout documentation for more details.

Note, that the _id field can't be part of the searchable data, so make sure the field is excluded or renamed in the toSearchableArray method in case you are using MongoDB as the database.

Basic usage

OpenSearch driver uses OpenSearch query string wrapped in a bool query under the hood. It means that you can use mini-language syntax when searching a model:

When the query string is omitted, the match all query is used:

Please refer to the official Laravel Scout documentation for more details and usage examples.

Advanced Search

In case the basic search doesn't cover your project needs check OpenSearch Scout Driver Plus, which extends standard Scout search capabilities by introducing advanced query builders. These builders give you possibility to use compound queries, custom filters and sorting, highlights and more.

Migrations

If you are looking for a way to control OpenSearch index schema programmatically check OpenSearch Migrations. OpenSearch Migrations allow you to modify application's index schema and share it across multiple environments with the same ease, that gives you Laravel database migrations.

Pitfalls

There are few things, which are slightly different from other Scout drivers:


All versions of opensearch-scout-driver with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
friendsofcat/opensearch-adapter Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package friendsofcat/opensearch-scout-driver contains the following files

Loading the files please wait ....