Triggers the actual search

@throws IOException if anything goes wrong
352033
private void search() throws IOException {

        String url = String.format(SEARCH_URL,
                term,
                (weightClass != null) ? weightClass.getValue() : "",
                page
        );

        dryEvents = new ArrayList<>();
        dryFighters = new ArrayList<>();

        List<SherdogBaseObject> parse = new SearchParser().parse(url);

        parse.forEach(r -> {
            if (r.getSherdogUrl().startsWith(Constants.BASE_URL + "/events/")) {
                dryEvents.add(r);
            } else if (r.getSherdogUrl().startsWith(Constants.BASE_URL + "/fighter/")) {
                dryFighters.add(r);
            }
        });
    }
536465
public boolean searchElement(String elementName) throws XMLException, IOException {
		try {
			do {
				if (Type.START_ELEMENT.equals(event.type)) {
					if (event.text.equals(elementName))
						return true;
				}
				next();
			} while (true);
		} catch (EOFException e) {
			return false;
		}
	}
495444
function instantSearch() {

    const q = $("#searchbox").val();
    if (q === '')
        return;

    const matcher = "/matcher?beginsWith=" + q;
    const request = host + matcher;

    console.debug(request);

    $.getJSON(request, '', {})
        .done(data => {

            $("#searchbox").autocomplete({
                source: data,
                select: (event) => {
                    event.stopPropagation();
                    $("#search").trigger("click");
                }
            });
        })
        .fail((d, textStatus, error) => {

            const err = d.status + " " + error + " -> message: " + d.responseText;
            bootstrapAlert.error(err);
            console.error(`Search request failed: \n ${err}`);
        });
}
210412
public function execute() {
        if (!\core_search\manager::is_indexing_enabled()) {
            return;
        }
        $globalsearch = \core_search\manager::instance();

        // Get total indexing time limit.
        $timelimit = get_config('core', 'searchindextime');
        $start = time();

        // Do normal indexing.
        $globalsearch->index(false, $timelimit, new \text_progress_trace());

        // Do requested indexing (if any) for the rest of the time.
        if ($timelimit != 0) {
            $now = time();
            $timelimit -= ($now - $start);
            if ($timelimit <= 1) {
                // There is hardly any time left, so don't try to do requests.
                return;
            }
        }
        $globalsearch->process_index_requests($timelimit, new \text_progress_trace());
    }
384634
public function postSearch(): void {
    if ($this->progress) {
      $iterator = $this->getIterator();

      if ($iterator instanceof \SplFileObject) {
        // Get current byte offset, after the line was read.
        $this->progress->setProgress($iterator->ftell());
      }
      elseif (is_int($key = $iterator->key())) {
        // Add one to the current index, because we're in the post-search phase.
        $this->progress->setProgress($key + 1);
      }
      else {
        // If iterator's key is not integer, just advance the progress with 1.
        $this->progress->advance();
      }
    }
  }
250513
private void checkAttempt(TaskAttemptID attemptId) throws IOException {
    if (!attemptId.equals(currentAttemptId)) {
      throw new IOException("Attempt " + attemptId
          + " does not match current attempt " + currentAttemptId);
    }
  }
280460
public function performSearch()
    {
        try {
            $index = Zend_Search_Lucene::open(self::get_index_location());

            Zend_Search_Lucene::setResultSetLimit(100);
            
            $query = new Zend_Search_Lucene_Search_Query_Boolean();
            $term = Zend_Search_Lucene_Search_QueryParser::parse($this->getQuery());
            $query->addSubquery($term, true);
            
            if ($this->modules) {
                $moduleQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
                
                foreach ($this->modules as $module) {
                    $moduleQuery->addTerm(new Zend_Search_Lucene_Index_Term($module, 'Entity'));
                }
                
                $query->addSubquery($moduleQuery, true);
            }

            if ($this->versions) {
                $versionQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
                
                foreach ($this->versions as $version) {
                    $versionQuery->addTerm(new Zend_Search_Lucene_Index_Term($version, 'Version'));
                }
                
                $query->addSubquery($versionQuery, true);
            }
            
            $er = error_reporting();
            error_reporting('E_ALL ^ E_NOTICE');
            $this->results = $index->find($query);
            error_reporting($er);
            $this->totalResults = $index->numDocs();
        } catch (Zend_Search_Lucene_Exception $e) {
            user_error($e .'. Ensure you have run the rebuld task (/dev/tasks/RebuildLuceneDocsIndex)', E_USER_ERROR);
        }
    }
266579
public boolean exists() throws IOException {
        boolean exists = false;
        try {
            // force lookup again
            setFileHandle(null);
            exists = (getFileHandle() != null);
        } catch (FileNotFoundException e) {
            // do nothing
        }
        return exists;
    }
911918
function()
    {
        if (!this._searchResults || !this._searchResults.length)
            return;
        var index = this._selectedSearchResult ? this._searchResults.indexOf(this._selectedSearchResult) : -1;
        this._jumpToSearchResult(index + 1);
    }
1046049
@Override
    public void actionCommit() {

        List<Throwable> errors = new ArrayList<Throwable>();

        try {

            // if new create it first
            if (!m_searchManager.getSearchIndexSources().keySet().contains(m_indexsource.getName())) {
                m_searchManager.addSearchIndexSource(m_indexsource);
            }
            writeConfiguration();

        } catch (Throwable t) {
            errors.add(t);
        }

        // set the list of errors to display when saving failed
        setCommitErrors(errors);
    }
1135649
protected function performSearch()
    {
        $filename = self::CONFIG_FILENAME . '.yml';
        $directories = array_filter(explode('/', getcwd()));

        $count = count($directories);
        for ($offset = 0; $offset < $count; ++$offset) {
            $next_path = '/' . implode('/', array_slice($directories, 0, $count - $offset));

            if (file_exists("{$next_path}/{$filename}")) {
                $this->projectXPath = "{$next_path}/{$filename}";
                break;
            }
        }
    }
158564
private void resumeSearch() throws RemoteException {
        org.fcrepo.server.types.gen.FieldSearchResult searchResult =
                apia.resumeFindObjects(token);
        FieldSearchResult fsr =
                TypeUtility
                        .convertGenFieldSearchResultToFieldSearchResult(searchResult);
        for (ObjectFields fields : fsr.objectFieldsList()) {
            stash.add(fields.getPid());
        }
        token = fsr.getToken();
    }
390846
public static void match(DatabaseClient client) throws IOException {
    // create a manager for document search criteria
    QueryManager queryMgr = client.newQueryManager();

    // specify the search criteria for the documents
    String criteria = "neighborhoods";
    StringQueryDefinition querydef = queryMgr.newStringDefinition();
    querydef.setCriteria(criteria);

    // create a manager for matching rules
    RuleManager ruleMgr = client.newRuleManager();

    // match the rules against the documents qualified by the criteria
    RuleDefinitionList matchedRules = ruleMgr.match(querydef, new RuleDefinitionList());

    // iterate over the matched rules
    Iterator<RuleDefinition> ruleItr = matchedRules.iterator();
    while (ruleItr.hasNext()) {
      RuleDefinition rule = ruleItr.next();
      System.out.println(
        "document criteria "+criteria+" matched rule "+
          rule.getName()+" with metadata "+rule.getMetadata()
      );
    }
  }
1300122
public function initializeSearchComponent()
    {
        if ($this->searchConfiguration['results.']['showDocumentScoreAnalysis']) {
            $this->queryBuilder->startFrom($this->query)->useDebug(true);
        }
    }
610068
private void doSearch()
    {
        setSearchPanelVisible(true);
        String selectedText = textComponent.getSelectedText();
        if (selectedText != null)
        {
            searchPanel.setQuery(selectedText);
        }
        searchPanel.requestFocusForTextField();
    }
180101
protected void check(File file) throws IOException {
        if(!file.exists()) {
            throw new FileNotFoundException(file.getAbsolutePath());
        }
        
        if(file.isDirectory()) {
            throw new IOException("Cannot open directory " + file.getAbsolutePath());
        }
    }
329333
private synchronized void initOut() throws IOException
   {
      if (out == null)
      {
         OutputStream os = new IndexOutputStream(dir.createOutput(REDO_LOG));
         out = new BufferedWriter(new OutputStreamWriter(os));
      }
   }