Esempio n. 1
0
 /**
  * Build a string for onscreen display showing the
  *   query used in the search (not the filters).
  *
  * @access  public
  * @return  string   user friendly version of 'query'
  */
 public function displayQuery()
 {
     // Maybe this is a restored object...
     if ($this->query == null) {
         $this->query = $this->indexEngine->buildQuery($this->searchTerms);
     }
     // Do we need the complex answer? Advanced searches
     if ($this->searchType == $this->advancedSearchType) {
         $output = $this->buildAdvancedDisplayQuery();
         // If there is a hardcoded public query (like tags) return that
     } else {
         if ($this->publicQuery != null) {
             $output = $this->publicQuery;
             // If we don't already have a public query, and this is a basic search
             // with case-insensitive booleans, we need to do some extra work to ensure
             // that we display the user's query back to them unmodified (i.e. without
             // capitalized Boolean operators)!
         } else {
             if (!$this->indexEngine->hasCaseSensitiveBooleans()) {
                 $output = $this->publicQuery = $this->indexEngine->buildQuery($this->searchTerms, true);
                 // Simple answer
             } else {
                 $output = $this->query;
             }
         }
     }
     // Empty searches will look odd to users
     if ($output == '*:*') {
         $output = "";
     }
     return $output;
 }