Ticket #91: svn.ticket93.search-on-unknown-string.patch
| File svn.ticket93.search-on-unknown-string.patch, 2.0 KB (added by sebastian, 2 years ago) |
|---|
-
controllers/explorer_controller.php
76 76 // Split the query so that we have a list of tags/categories/locations. 77 77 // For now we split at whitespaces, improvements could be made to not 78 78 // split multiple tags/categories/locations enclosed in quotation marks 79 $ quicksearch= preg_split('/\s+/', trim($quicksearch));79 $words = preg_split('/\s+/', trim($quicksearch)); 80 80 81 81 // Reduce results to 6 82 82 $this->Search->setShow(6); 83 83 84 84 // Add tag to the query 85 $this->Search->addTags($ quicksearch);85 $this->Search->addTags($words); 86 86 // Set variable dataTags for view 87 87 $this->Search->setTagOp('OR'); 88 88 $this->set('dataTags', $this->Search->paginate()); … … 90 90 $this->Search->delTags(); 91 91 $this->Search->delTagOp(); 92 92 93 $this->Search->addCategories($ quicksearch);93 $this->Search->addCategories($words); 94 94 $this->Search->setCategoryOp('OR'); 95 95 $this->set('dataCategories', $this->Search->paginate()); 96 96 $this->Search->delCategories(); 97 97 $this->Search->delCategoryOp(); 98 98 99 $this->Search->addLocations($ quicksearch);99 $this->Search->addLocations($words); 100 100 $this->Search->setLocationOp('OR'); 101 101 $this->set('dataLocations', $this->Search->paginate()); 102 102 $this->Search->delLocations(); -
views/explorer/quicksearch.ctp
12 12 13 13 if (count($dataTags) + count($dataCategories) + count($dataLocations) == 0): ?> 14 14 <div class="info"> 15 Sorry, nothing was found for <?php echo $quicksearch; ?>15 Sorry, nothing was found for <?php echo h($quicksearch); ?> 16 16 </div> 17 17 <?php endif; ?> 18 18
