}
if (isset($inputs['types']) && count($inputs['types']) < 4) {
- $cleanedFilters[] = new FilterSearchOption(implode('|', $inputs['types']), 'types');
+ $cleanedFilters[] = new FilterSearchOption(implode('|', $inputs['types']), 'type');
}
$instance->filters = new SearchOptionSet($cleanedFilters);
protected static function parseStandardTermString(string $termString): array
{
$terms = explode(' ', $termString);
- $indexDelimiters = SearchIndex::$delimiters;
+ $indexDelimiters = implode('', array_diff(str_split(SearchIndex::$delimiters), str_split(SearchIndex::$softDelimiters)));
$parsed = [
'terms' => [],
'exacts' => [],
{
$options = [];
- // Non-[created/updated]-by-me options
+ // Handle filters without UI support
$userFilters = ['updated_by', 'created_by', 'owned_by'];
+ $unsupportedFilters = ['is_template', 'sort_by'];
foreach ($this->filters->all() as $filter) {
if (in_array($filter->getKey(), $userFilters, true) && $filter->value !== null && $filter->value !== 'me') {
$options[] = $filter;
+ } else if (in_array($filter->getKey(), $unsupportedFilters, true)) {
+ $options[] = $filter;
}
}
// Negated items
- array_push($options, ...$this->exacts->negated());
- array_push($options, ...$this->tags->negated());
- array_push($options, ...$this->filters->negated());
+ array_push($options, ...$this->exacts->negated()->all());
+ array_push($options, ...$this->tags->negated()->all());
+ array_push($options, ...$this->filters->negated()->all());
return implode(' ', array_map(fn(SearchOption $o) => $o->toString(), $options));
}