search fix
This commit is contained in:
parent
7bfcb58878
commit
1f58f19a76
|
|
@ -120,7 +120,7 @@ return [
|
|||
'key' => env('MEILISEARCH_KEY', 'qazwsx12qazwsx12'),
|
||||
'index-settings' => [
|
||||
\Webkul\Product\Models\ProductFlat::class => [
|
||||
'filterableAttributes'=> ['locale', 'channel' ],
|
||||
// 'filterableAttributes'=> ['locale', 'channel' ],
|
||||
'sortableAttributes' => ['name','created_at','min_price'],
|
||||
// Other settings fields...
|
||||
],
|
||||
|
|
|
|||
|
|
@ -53,15 +53,23 @@ class ProductFlat extends Model implements ProductFlatContract
|
|||
{
|
||||
return 'products_index';
|
||||
}
|
||||
|
||||
public function searchable(): bool
|
||||
{
|
||||
return $this->status || $this->visible_individually;
|
||||
}
|
||||
|
||||
public function toSearchableArray():array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'meta_keywords' => $this->meta_keywords,
|
||||
'min_price' => $this->min_price,
|
||||
'status' => $this->status,
|
||||
'visible_individually'=> $this->visible_individually,
|
||||
'product_id' => $this->product_id
|
||||
'product_id' => $this->product_id,
|
||||
'created_at' => $this->created_at,
|
||||
];
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue