Download the PHP package codeartmk/opensearch-laravel without Composer

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

Build Opensearch Queries through Eloquent

Latest Version on Packagist Total Downloads

Overview

This package integrates the Opensearch client to work seamlessly with your Laravel Eloquent Model.

Installation

To install the Laravel OpenSearch Plugin, use Composer:

and then export the configuration with

Basic usage

Setting up the model

Your models will need to implement the Codeart\OpensearchLaravel\OpenSearchable interface, and include the trait Codeart\OpensearchLaravel\Traits\HasOpenSearchDocuments.

You can override the 3 functions openSearchMapping, openSearchArray, and openSearchIndexName to customize your mapping, the information stored and the index name.

For mapping options look at OpenSearch mapping documentation.

Building queries and aggregations

Once the model is ready you can start building your queries and aggregation through the opensearch method on the class:

Supported Query DSL queries:

Match

https://opensearch.org/docs/latest/query-dsl/full-text/match/

Exists

https://opensearch.org/docs/latest/query-dsl/term/exists/

Fuzzy

https://opensearch.org/docs/latest/query-dsl/term/fuzzy/

IDs

https://opensearch.org/docs/latest/query-dsl/term/ids/

Prefix

https://opensearch.org/docs/latest/query-dsl/term/prefix/

Range

https://opensearch.org/docs/latest/query-dsl/term/range/

Regexp

https://opensearch.org/docs/latest/query-dsl/term/regexp/

Wildcard

https://opensearch.org/docs/latest/query-dsl/term/wildcard/

Match All

https://opensearch.org/docs/latest/query-dsl/match-all/

Match Phrase Prefix

https://opensearch.org/docs/latest/query-dsl/full-text/match-phrase-prefix/

Term

https://opensearch.org/docs/latest/query-dsl/term/term/

Supported Aggregations

Average

https://opensearch.org/docs/latest/aggregations/metric/average/

Cardinality

https://opensearch.org/docs/latest/aggregations/metric/cardinality/

Maximum

https://opensearch.org/docs/latest/aggregations/metric/maximum/

Minimum

https://opensearch.org/docs/latest/aggregations/metric/minimum/

Percentile

https://opensearch.org/docs/latest/aggregations/metric/percentile/

Stats

https://opensearch.org/docs/latest/aggregations/metric/stats/

Sum

https://opensearch.org/docs/latest/aggregations/metric/sum/

Terms

https://opensearch.org/docs/latest/aggregations/bucket/terms/

Bucket Sort

https://opensearch.org/docs/latest/aggregations/pipeline-agg/#bucket_sort

We plan to support more in the feature.

Working with indices and documents

We offer tools to help you work with Opensearch indices and documents.

Indices

We have the methods create, exists, and delete currently.

The optional $configuration parameter in the create method allows you to customize your settings for your index.

Documents

Lazy Loading Relationship

The methods createAll, create, and createOrUpdate all accept a function as a second parameter to allow you to lazy load your relationship when creating documents.

Extending the functionality

If we've missed a search query you need or an aggregation you need, you can easily implement your own and integrate it to work our core functionality.

Search Query

Create a custom class and implement the SearchQueryType and OpenSearchQuery interfaces. If you were to implement the Query String query it would look like the following:

and then just call it.

Aggregations

You can achieve the same for aggregations but instead of SearchQueryType you need to implement the AggregationType inteface.

Contact Us

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of opensearch-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
opensearch-project/opensearch-php Version ^2.2
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 codeartmk/opensearch-laravel contains the following files

Loading the files please wait ....