@@ -1331,38 +1331,6 @@ public function orWhereNotRegex($column, string $value, array $options = []): se
13311331 return $ this ->whereRegex ($ column , $ value , 'or ' , true , $ options );
13321332 }
13331333
1334- /**
1335- * Add a 'query_string' statement to query
1336- */
1337- public function whereQueryString ($ column , $ value , array $ options = []): self
1338- {
1339- return $ this ->_buildQueryStringWheres ($ column , $ value , 'and ' , false , $ options );
1340- }
1341-
1342- public function orWhereQueryString ($ column , $ value , array $ options = []): self
1343- {
1344- return $ this ->_buildQueryStringWheres ($ column , $ value , 'or ' , false , $ options );
1345- }
1346-
1347- public function whereNotQueryString ($ column , $ value , array $ options = []): self
1348- {
1349- return $ this ->_buildQueryStringWheres ($ column , $ value , 'and ' , true , $ options );
1350- }
1351-
1352- public function orWhereNotQueryString ($ column , $ value , array $ options = []): self
1353- {
1354- return $ this ->_buildQueryStringWheres ($ column , $ value , 'or ' , true , $ options );
1355- }
1356-
1357- private function _buildQueryStringWheres ($ column , $ value , $ boolean , $ not , $ options ): self
1358- {
1359- $ type = 'QueryString ' ;
1360-
1361- $ this ->wheres [] = compact ('column ' , 'value ' , 'type ' , 'boolean ' , 'not ' , 'options ' );
1362-
1363- return $ this ;
1364- }
1365-
13661334 /**
13671335 * Add any where clause with given options.
13681336 */
@@ -1595,6 +1563,52 @@ public function orSearchNotFuzzyPrefix($query, mixed $columns = null, $options =
15951563 return $ this ->search ($ query , 'bool_prefix ' , $ columns , $ options , true , 'or ' , ['fuzziness ' => 'AUTO ' ]);
15961564 }
15971565
1566+ /**
1567+ * Add a 'query_string' statement to query
1568+ *
1569+ * @throws Exception
1570+ */
1571+ public function searchQueryString (mixed $ query , string |array $ columns = '* ' , $ options = []): self
1572+ {
1573+ return $ this ->_buildQueryStringWheres ($ columns , $ query , 'and ' , false , $ options );
1574+ }
1575+
1576+ /**
1577+ * @throws Exception
1578+ */
1579+ public function orSearchQueryString (mixed $ query , string |array $ columns = '* ' , $ options = []): self
1580+ {
1581+ return $ this ->_buildQueryStringWheres ($ columns , $ query , 'or ' , false , $ options );
1582+ }
1583+
1584+ /**
1585+ * @throws Exception
1586+ */
1587+ public function searchNotQueryString (mixed $ query , string |array $ columns = '* ' , $ options = []): self
1588+ {
1589+ return $ this ->_buildQueryStringWheres ($ columns , $ query , 'and ' , true , $ options );
1590+ }
1591+
1592+ /**
1593+ * @throws Exception
1594+ */
1595+ public function orSearchNotQueryString (mixed $ query , string |array $ columns = '* ' , $ options = []): self
1596+ {
1597+ return $ this ->_buildQueryStringWheres ($ columns , $ query , 'or ' , true , $ options );
1598+ }
1599+
1600+ /**
1601+ * @throws Exception
1602+ */
1603+ private function _buildQueryStringWheres ($ column , $ value , $ boolean , $ not , $ options ): self
1604+ {
1605+ $ type = 'QueryString ' ;
1606+ $ options = $ this ->setOptions ($ options , 'querystring ' )->toArray ();
1607+ $ this ->wheres [] = compact ('column ' , 'value ' , 'type ' , 'boolean ' , 'not ' , 'options ' );
1608+
1609+ return $ this ;
1610+ }
1611+
15981612 // ----------------------------------------------------------------------
15991613 // Ordering
16001614 // ----------------------------------------------------------------------
0 commit comments