Installation Elasticsearch

This commit is contained in:
Yann Gonidec 2019-08-07 09:36:02 +02:00
parent e825c7b19f
commit e293d437e7
5 changed files with 1069 additions and 377 deletions

View file

@ -4,13 +4,22 @@ namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Elasticquent\ElasticquentTrait;
class Media extends Model
{
use ElasticquentTrait;
use SoftDeletes;
protected $with = "owner";
protected $table = "medias";
protected $mappingProperties = array(
'libelle' => array(
'type' => 'string',
'analyzer' => 'standard'
)
);
/**
* Get the dossier that owns the media.
*/

View file

@ -14,7 +14,8 @@
"james-heinrich/getid3": "^1.9",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.8"
"laravelcollective/html": "^5.8",
"elasticquent/elasticquent": "dev-master"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",

1399
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -166,7 +166,7 @@ return [
/*
* Package Service Providers...
*/
Elasticquent\ElasticquentServiceProvider::class,
/*
* Application Service Providers...
*/
@ -229,6 +229,7 @@ return [
'Adldap' => Adldap\Laravel\Facades\Adldap::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Es' => Elasticquent\ElasticquentElasticsearchFacade::class,
],
];

32
config/elasticquent.php Normal file
View file

@ -0,0 +1,32 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Custom Elasticsearch Client Configuration
|--------------------------------------------------------------------------
|
| This array will be passed to the Elasticsearch client.
| See configuration options here:
|
| http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html
*/
'config' => [
'hosts' => ['http://127.0.0.1:9200'],
'retries' => 1,
],
/*
|--------------------------------------------------------------------------
| Default Index Name
|--------------------------------------------------------------------------
|
| This is the index name that Elasticquent will use for all
| Elasticquent models.
*/
'default_index' => 'dam_index',
);