File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -162,18 +162,14 @@ public function __construct(Typesense $typesense)
162
162
*/
163
163
public function update ($ models ): void
164
164
{
165
- $ changes = $ models ->first ()->getDirty ();
166
- $ searchableArray = $ models ->first ()->toSearchableArray ();
167
- if (!empty (array_intersect (array_keys ($ changes ), array_keys ($ searchableArray )))) {
168
- $ collection = $ this ->typesense ->getCollectionIndex ($ models ->first ());
165
+ $ collection = $ this ->typesense ->getCollectionIndex ($ models ->first ());
169
166
170
- if ($ this ->usesSoftDelete ($ models ->first ()) && config ('scout.soft_delete ' , false )) {
171
- $ models ->each ->pushSoftDeleteMetadata ();
172
- }
173
-
174
- $ this ->typesense ->importDocuments ($ collection , $ models ->map (fn ($ m ) => $ m ->toSearchableArray ())
175
- ->toArray ());
167
+ if ($ this ->usesSoftDelete ($ models ->first ()) && config ('scout.soft_delete ' , false )) {
168
+ $ models ->each ->pushSoftDeleteMetadata ();
176
169
}
170
+
171
+ $ this ->typesense ->importDocuments ($ collection , $ models ->map (fn ($ m ) => $ m ->toSearchableArray ())
172
+ ->toArray ());
177
173
}
178
174
179
175
/**
You can’t perform that action at this time.
0 commit comments