Scout Extended的最新功能非常出色,可以在laravel中使用Algolia Search API。但是用scoutKey保存模型路径的值是一种不好的方法。
在加密时,它在ObjectIdEncrypter类中使用以下内容:
public static function encrypt($searchable,int $part = null): string
{
$scoutKey = method_exists($searchable,'getScoutKey') ? $searchable->getScoutKey() : $searchable->getKey();
$meta = [get_class($searchable->getModel()),$scoutKey];
if ($part !== null) {
$meta[] = $part;
}
return implode(self::$separator,$meta);
}
因此,objectID的导入方式如下:objectID: {ModelPath}::scoutKey
还会显示一个包含模型路径的字符串。 任何人都可以在这件事上提供帮助。