atan/opensearch

Aliyun Openearch for Laravel 5

1.0.2 2015-12-30 01:46 UTC

This package is auto-updated.

Last update: 2024-12-12 07:13:32 UTC


README

Aliyun Opeansearch for Laravel 5

Install

Via Composer

$ composer require atan/opensearch

As with most Laravel 5 packages you'll then need to register the Opensearch service provider. To do that, head over your config/app.php file and add the following line into the providers array:

Atan\Opensearch\OpensearchServiceProvider::class,

Add the BootForm facade to the aliases array in config/app.php:

'Opensearch' => Atan\Opensearch\Facades\Opensearch::class,

Configuration

Publish all vendor assets

php artisan vendor:publish

Usage

$opensearch = Opensearch::connect();
$opensearch->setQueryString("default:'关键词'");
$opensearch->setFormat('json');

$result = $opensearch->search();

License

The MIT License (MIT). Please see License File for more information.