search refactor3

This commit is contained in:
merdan 2023-08-15 14:40:30 +05:00
parent 763f45ade9
commit 846e1aa391
2 changed files with 19 additions and 1 deletions

15
config/meilisearch.php Normal file
View File

@ -0,0 +1,15 @@
<?php
return [
'meilisearch' => [
'host' => env('MEILISEARCH_HOST', 'http://localhost:7700'),
'key' => env('MEILISEARCH_KEY', null),
'index-settings' => [
\Webkul\Product\Models\ProductFlat::class => [
'filterableAttributes'=> ['locale', 'channel' ],
'sortableAttributes' => ['created_at'],
// Other settings fields...
],
],
],
];

View File

@ -49,7 +49,10 @@ class ProductFlat extends Model implements ProductFlatContract
{
return 'products_index';
}
public function searchable(): bool
{
return $this->status || $this->visible_individually;
}
/**
* Get an attribute from the model.
*