【发布时间】:2021-02-24 09:50:59
【问题描述】:
我正在尝试将“babenkoivan/scout-elasticsearch-driver”与“astrotomic/laravel-translatable”一起使用,但我不明白如何索引翻译后的单词。
我的模型看起来像:
namespace App\Models;
use Astrotomic\Translatable\Translatable;
use App\Models\Search\ShowIndexConfigurator;
use ScoutElastic\Searchable;
...
class Show extends BaseModel
{
...
use Translatable;
use Searchable;
protected $indexConfigurator = ShowIndexConfigurator::class;
protected $searchRules = [
//
];
protected $mapping = [
'properties' => [
// How to index localized translations ???
'title' => [
'type' => 'string'
],
]
];
....
public $translatedAttributes = [
...,
'title'
...
];
最好的问候
【问题讨论】:
标签: laravel elasticsearch laravel-scout