Download the PHP package cloudmediasolutions/laravel-scout-opensearch without Composer

On this page you can find all versions of the php package cloudmediasolutions/laravel-scout-opensearch. 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 laravel-scout-opensearch

OpenSearch Engine for Laravel Scout

This package provides an OpenSearch engine for Laravel Scout. It's built on top of the latest release of Laravel Scout and lets you use OpenSearch as a driver for Scout.

Features

Requirements

Installation

You can include this package via Composer:

composer require "cloudmediasolutions/laravel-scout-opensearch"

Add / set environment variables (in .env):

SCOUT_DRIVER=CloudMediaSolutions\LaravelScoutOpenSearch\Engines\OpenSearchEngine

Add your OpenSearch host(s): (You can seperate multiple hosts with a comma)

OPENSEARCH_HOSTS=http://localhost:9200

If you have any web authentication on your OpenSearch cluster, you can extend the opensearch.client config.

Basic authentication:

Usage

Before you can use custom index settings and mappings, you have to publish the config to your application:

php artisan vendor:publish --tag "opensearch-config"

After changing indexes you have to create the index:

If the index already exists, delete it first:

php artisan scout:delete-index yourSearchableAsValue

Then you can create the index:

php artisan scout:index yourSearchableAsValue

The index is at this point completely empty. You can import existing data as described in the Laravel Scout documentation:

php artisan scout:import "App\Models\Post"

Index settings

Some index settings are static and can only be set on index creation. That's why it is important to configure it - when you have specific whishes - before you start using an index.

You can find an example in opensearch.indices.default.settings. Default is the key as default / fallback configuration. When you want a setting for a specific index, you use opensearch.indices.yourSearchableAsValue.settings.

Mappings

Sometimes you need specific field mappings in OpenSearch. For example, when you use UUID's, the field type is automatically set to text and it can be usefull to have them as keyword in filters.

You can find an example in opensearch.indices.table.mappings. Table is in this case your index name.

Search

You can search data as documented by Laravel in their docs. Because this search query uses query_string in the search query to OpenSearch, it is possible to execute complex queries, such as:

Cursor pagination

Cursor pagination uses search_after parameter pagination.

If no sorting provided, the _id field will be used as default, and therefore no relevance sorting can be applied when using cursor pagination.

Cursor pagination with sort mode

Cursor pagination with nested object sort

Cursor pagination with _geo_distance


All versions of laravel-scout-opensearch with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/scout Version ^8.0|^9.0|^10.0
opensearch-project/opensearch-php Version ^2.0
illuminate/support Version ^9.0|^10.0
shyim/opensearch-php-dsl Version ^1.0
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 cloudmediasolutions/laravel-scout-opensearch contains the following files

Loading the files please wait ....