]> BookStack Code Mirror - bookstack/blobdiff - app/Search/SearchOptions.php
Customization: Added parent tag classes
[bookstack] / app / Search / SearchOptions.php
index 7f9db2a64302b7dbea4f860a2919ec5b0dbd3de3..bf527d9c3058c1a87f988212da0d086c63fe66e6 100644 (file)
@@ -73,7 +73,7 @@ class SearchOptions
         }
 
         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);
@@ -181,7 +181,7 @@ class SearchOptions
     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' => [],
@@ -235,11 +235,14 @@ class SearchOptions
     {
         $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;
             }
         }