Skip to content

Commit 295ac8a

Browse files
committed
Remove support for simple_query_string queries
Eliminated methods and logic related to 'simple_query_string' queries from Builder, DslFactory, and Grammar. All query string handling now uses the standard 'query_string' type for consistency and simplification.
1 parent 84923a3 commit 295ac8a

File tree

3 files changed

+4
-47
lines changed

3 files changed

+4
-47
lines changed

src/Query/Builder.php

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,46 +1597,12 @@ public function orSearchNotQueryString(mixed $query, mixed $columns = null, $opt
15971597
return $this->_buildQueryStringWheres($columns, $query, 'or', true, $options);
15981598
}
15991599

1600-
/**
1601-
* Add a 'simple_query_string' statement to query
1602-
*
1603-
* @throws Exception
1604-
*/
1605-
public function searchSimpleQueryString(mixed $query, mixed $columns = null, $options = []): self
1606-
{
1607-
return $this->_buildQueryStringWheres($columns, $query, 'and', false, $options, 'SimpleQueryString');
1608-
}
1609-
1610-
/**
1611-
* @throws Exception
1612-
*/
1613-
public function orSearchSimpleQueryString(mixed $query, mixed $columns = null, $options = []): self
1614-
{
1615-
return $this->_buildQueryStringWheres($columns, $query, 'or', false, $options, 'SimpleQueryString');
1616-
}
1617-
16181600
/**
16191601
* @throws Exception
16201602
*/
1621-
public function searchNotSimpleQueryString(mixed $query, mixed $columns = null, $options = []): self
1603+
private function _buildQueryStringWheres($columns, $value, $boolean, $not, $options): self
16221604
{
1623-
return $this->_buildQueryStringWheres($columns, $query, 'and', true, $options, 'SimpleQueryString');
1624-
}
1625-
1626-
/**
1627-
* @throws Exception
1628-
*/
1629-
public function orSearchNotSimpleQueryString(mixed $query, mixed $columns = null, $options = []): self
1630-
{
1631-
return $this->_buildQueryStringWheres($columns, $query, 'or', true, $options, 'SimpleQueryString');
1632-
}
1633-
1634-
/**
1635-
* @throws Exception
1636-
*/
1637-
private function _buildQueryStringWheres($columns, $value, $boolean, $not, $options, $type = 'QueryString'): self
1638-
{
1639-
1605+
$type = 'QueryString';
16401606
[$columns, $options] = $this->extractSearch($columns, $options, 'querystring');
16411607
$options = $this->setOptions($options, 'querystring')->toArray();
16421608
$this->wheres[] = compact('columns', 'value', 'type', 'boolean', 'not', 'options');

src/Query/DSL/DslFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,15 @@ public static function functionScore(array $query, string $functionType, array $
267267
];
268268
}
269269

270-
public static function queryString(mixed $query, mixed $fields, array $options = [], $type = 'query_string')
270+
public static function queryString(mixed $query, mixed $fields, array $options = [])
271271
{
272272
$payload['query'] = (string) $query;
273273
if ($fields) {
274274
$payload['fields'] = is_array($fields) ? $fields : [$fields];
275275
}
276276

277277
return [
278-
$type => array_merge(
278+
'query_string' => array_merge(
279279
$payload,
280280
$options
281281
),

src/Query/Grammar.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,6 @@ private function compileWhereQueryString(Builder $builder, array $where)
730730
return DslFactory::queryString($query, $fields, $options);
731731
}
732732

733-
private function compileWhereSimpleQueryString(Builder $builder, array $where)
734-
{
735-
$fields = $where['columns'];
736-
$query = $where['value'];
737-
$options = $where['options'] ?? [];
738-
739-
return DslFactory::queryString($query, $fields, $options, 'simple_query_string');
740-
}
741-
742733
/**
743734
* Compile a child clause
744735
*/

0 commit comments

Comments
 (0)