File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,11 @@ private function wheresToFilter(array $wheres): string
6262 break ;
6363
6464 default :
65- $ filterBy .= $ where ['column ' ].': ' .($ where ['operator ' ] != '= ' ? $ where ['operator ' ] : '' ).$ this ->transformValueForTypeSense ($ schemaType , $ where ['value ' ]);
65+ if ($ where ['operator ' ] == 'like ' ) {
66+ $ where ['value ' ] = str_replace (['%" ' , '"% ' ], '' , $ where ['value ' ]);
67+ }
68+
69+ $ filterBy .= $ where ['column ' ].': ' .(! in_array ($ where ['operator ' ], ['like ' ]) ? $ where ['operator ' ] : '' ).$ this ->transformValueForTypeSense ($ schemaType , $ where ['value ' ]);
6670 break ;
6771 }
6872
@@ -73,11 +77,11 @@ private function wheresToFilter(array $wheres): string
7377 return $ filterBy ;
7478 }
7579
76- private function transformArrayOfValuesForTypeSense (string $ schemaType , array $ values ): array
80+ private function transformArrayOfValuesForTypeSense (string $ schemaType , array $ values ): string
7781 {
7882 return json_encode (
79- collect ($ where [ ' values ' ] )
80- ->map (fn ($ value ) => $ this ->transformValueForTypeSense ($ schemaType , $ values ))
83+ collect ($ values )
84+ ->map (fn ($ value ) => ray ( $ value ) && $ this ->transformValueForTypeSense ($ schemaType , $ value ))
8185 ->values ()
8286 ->all ()
8387 );
You can’t perform that action at this time.
0 commit comments