mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
added elasticsearch driver
This commit is contained in:
parent
461ccf3db6
commit
81b00d28ca
@ -144,7 +144,16 @@ $app->instance('JikanParser', $jikan);
|
||||
|
||||
$app->instance('SerializerV4', SerializerFactory::createV4());
|
||||
$app->register(Laravel\Scout\ScoutServiceProvider::class);
|
||||
$app->register(Typesense\LaravelTypesense\TypesenseServiceProvider::class);
|
||||
|
||||
// we support TypeSense and ElasticSearch as search indexes.
|
||||
if (env("SCOUT_DRIVER") === "typsense") {
|
||||
// in this case the TYPESENSE_HOST env var should be set too
|
||||
$app->register(Typesense\LaravelTypesense\TypesenseServiceProvider::class);
|
||||
}
|
||||
if (env("SCOUT_DRIVER") === "Matchish\ScoutElasticSearch\Engines\ElasticSearchEngine") {
|
||||
// in this case the ELASTICSEARCH_HOST env var should be set too
|
||||
$app->register(\Matchish\ScoutElasticSearch\ElasticSearchServiceProvider::class);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -19,8 +19,9 @@
|
||||
"jms/serializer": "^3.0",
|
||||
"laravel/legacy-factories": "^1.1",
|
||||
"laravel/lumen-framework": "^9.0",
|
||||
"league/flysystem": "^3.0",
|
||||
"laravel/scout": "^9.4",
|
||||
"league/flysystem": "^3.0",
|
||||
"matchish/laravel-scout-elasticsearch": "^6.0",
|
||||
"ocramius/package-versions": "^2.5",
|
||||
"predis/predis": "^1.1",
|
||||
"sentry/sentry-laravel": "^2.8",
|
||||
|
@ -152,4 +152,24 @@ return [
|
||||
'retry_interval_seconds' => 1,
|
||||
],
|
||||
|
||||
'elasticsearch' => [
|
||||
'host' => env('ELASTICSEARCH_HOST'),
|
||||
'indices' => [
|
||||
'mappings' => [
|
||||
'default' => [
|
||||
'properties' => [
|
||||
'id' => [
|
||||
'type' => 'keyword',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'settings' => [
|
||||
'default' => [
|
||||
'number_of_shards' => 1,
|
||||
'number_of_replicas' => 0,
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user