Fix search query. #2713

This commit is contained in:
James Cole
2019-10-10 20:50:40 +02:00
parent 22f63fd951
commit 460906fdfe
3 changed files with 10 additions and 7 deletions

View File

@@ -123,10 +123,13 @@ class Search implements SearchInterface
{
$filteredQuery = app('steam')->cleanString($query);
$this->originalQuery = $filteredQuery;
$pattern = '/[[:alpha:]_]*:"?[\p{L}_-]*"?/ui';
$pattern = '/[[:alpha:]_]*:"?[\P{C}_-]*"?/ui';
$matches = [];
preg_match_all($pattern, $filteredQuery, $matches);
var_dump($matches[0]);
exit;
foreach ($matches[0] as $match) {
$this->extractModifier($match);
$filteredQuery = str_replace($match, '', $filteredQuery);
@@ -288,12 +291,12 @@ class Search implements SearchInterface
$after = new Carbon($modifier['value']);
$collector->setAfter($after);
break;
case 'created_at':
case 'created_on':
Log::debug(sprintf('Set "%s" using collector with value "%s"', $modifier['type'], $modifier['value']));
$createdAt = new Carbon($modifier['value']);
$collector->setCreatedAt($createdAt);
break;
case 'updated_at':
case 'updated_on':
Log::debug(sprintf('Set "%s" using collector with value "%s"', $modifier['type'], $modifier['value']));
$updatedAt = new Carbon($modifier['value']);
$collector->setUpdatedAt($updatedAt);