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
194a17881b
commit
b0e3b05a7c
@ -149,7 +149,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);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -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