Laravel scout Algolia 是否可以在不将项目从本地数据库中删除的情况下从搜索索引中删除项目

Laravel scout Algolia Is there anyway to remove an item from the search index without removing it from the local db

我知道我可以通过以下方式从搜索索引中删除项目:

$order = App\Order::find(1);
$order->delete();

App\Order::where('price', '>', 100)->unsearchable();

但我只想将其从搜索中删除 index/Algolia 并仍将其保留在我的本地数据库中,这可能吗?

你的第二个片段是正确的,unsearchable将从 Algolia 中删除记录,但将其保留在你的本地数据库中。

App\Order::find(1)->unsearchable();