@param string|null $searchString
@param string[] $requestParameters

@return \Elastica\ResultSet
199091
public function conditionalAvailabilitySkuSearch(?string $searchString, array $requestParameters = []): ResultSet
    {
        $searchQuery = $this->getFactory()->createConditionalAvailabilitySkuSearchQuery($searchString);
        $searchQuery = $this->expandQuery($searchQuery, $this->getFactory()->getConditionalAvailabilitySkuSearchQueryExpanderPlugins(), $requestParameters);
        $resultFormatters = $this->getFactory()->getConditionalAvailabilitySkuSearchQueryFormatterPlugins();

        return $this->search($searchQuery, $resultFormatters, $requestParameters);
    }
1305277
public function searchItems($itemType, array $queryString = []) {
      $options = [];
      if ($queryString) {
         $options['query'] = $queryString;
      }
      $response = $this->client->request('get', 'search/' . $itemType, $options);
      return [
         'statusCode' => $response->getStatusCode(),
         'body' => $response->getBody()->getContents(),
      ];
   }
1196575
public function buildSearchArray($queryParameters)
    {
        $allowedStringCriteria = array('name', 'dateFrom', 'dateTo');
        $allowedArrayCriteria = array('types');
        $criteria = array();

        foreach ($queryParameters as $parameter => $value) {
            if (in_array($parameter, $allowedStringCriteria) && is_string($value)) {
                $criteria[$parameter] = $value;
            } elseif (in_array($parameter, $allowedArrayCriteria) && is_array($value)) {
                $criteria[$parameter] = $value;
            }
        }

        return $criteria;
    }
23432
public function searchAction(Request $request, $string)
    {
        $ret = [];

        foreach ($this->getFinderRegistry()->all() as $searcher) {
            $local = $searcher->find($string, false, 16);
            if ($local) {
                foreach ($local as $result) {
                    $ret[] = [
                        'id'          => $result->getId(),
                        'type'        => $result->getType(),
                        'title'       => check_plain($result->getTitle()),
                        'group'       => check_plain($result->getGroup()),
                        'description' => check_plain($result->getDescription()),
                    ];
                }
            }
        }

        return new JsonResponse($ret);
    }
281314
public function setQueryString(string $queryString) : Request
    {
        $this->queryString = (string) $queryString;
        parse_str($this->queryString, $this->query);

        return $this->updateRequestUri();
    }
775738
public function execute(SearchParams $searchParams) {
        $path = self::getPath($searchParams);
        $params = SuggestParamsBuilder::getQueryParams($searchParams);
        return $this->openSearchClient->get($path, $params);
    }
1272006
private function extractAndGroupUriFromParameters(array $requestParameters, array $filterNames)
    {
        if (empty($filterNames)) {
            return [];
        }

        $groupedUris = [];

        foreach ($this->flattenArray($requestParameters) as $key => $value) {
            $encodedUri = $this->getEncodedUri($value);

            if (in_array($key, $filterNames, true) && common_Utils::isUri($encodedUri)) {
                $groupedUris[$key][] = $encodedUri;
            }
        }

        return $groupedUris;
    }
725835
public function runQuery($queryString){

		$this->affectedRows = false;
		if($this->dbCharset !== null)
			$queryString = iconv($this->charset, $this->dbCharset . '//IGNORE', $queryString);

		if($this->unbuffered)
			$result = @sqlite_unbuffered_query($this->resource, $queryString, null, $error);
		else
			$result = @sqlite_query($this->resource, $queryString, null, $error);

		if($error && $result === false)
			throw new DriverException($error, sqlite_last_error($this->resource), $queryString);

		$this->affectedRows = @sqlite_changes($this->resource);
		return $result;
	}
936887
private function parseQueryString($queryString)
    {
        parse_str($queryString, $parsed);

        $supported = $this->getSupportedParams();
        foreach ($parsed as $param => $value) {
            if (!isset($supported[$param])) {
                throw RestException::unsupportedQueryParam($param, array_keys($supported));
            }
        }

        $this->extractInclusions($parsed);
        $this->extractSorting($parsed);
        $this->extractFields($parsed);
        $this->extractPagination($parsed);
        $this->extractFilters($parsed);
        return $this;
    }
491925
public static function periodAsSql($searchString, $fieldName, array $options = []) {
		$period = static::period($searchString, $options);
		return static::daysAsSql($period[0], $period[1], $fieldName);
	}
1049627
public function dispatch($requestUrl = null, $requestMethod = null) 
	{
		$params = array();
		$match = false;
		// set Request Url if it isn't passed as parameter
		if ($requestUrl === null) {
			$requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
		}
		// strip base path from request url
		$requestUrl = substr($requestUrl, strlen($this->basePath));
		// Strip query string (?a=b) from Request Url
		if (($strpos = strpos($requestUrl, '?')) !== false) {
			$requestUrl = substr($requestUrl, 0, $strpos);
		}
		// Strip anchors from the url
		// if (($strpos = strpos($requestUrl, '#')) !== false) {
		// 	$requestUrl = substr($requestUrl, 0, $strpos);
		// }
		// set Request Method if it isn't passed as a parameter
		if ($requestMethod === null) {
			$requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
		}
		foreach ($this->routes as $handler) {
			list($method, $_route, $target, $name) = $handler;
			$methods = explode('|', $method);
			$method_match = false;
			// Check if request method matches. If not, abandon early. (CHEAP)
			foreach ($methods as $method) {
				if (strcasecmp($requestMethod, $method) === 0) {
					$method_match = true;
					break;
				}
			}
			// Method did not match, continue to next route.
			if (!$method_match) {
				continue;
			}
			// Check for a wildcard (matches all)
			if ($_route === '*') {
				$match = true;
			} elseif (isset($_route[0]) && $_route[0] === '@') {
				$pattern = '`' . substr($_route, 1) . '`u';
				$match = preg_match($pattern, $requestUrl, $params);
			} else {
				$route = null;
				$regex = false;
				$j = 0;
				$n = isset($_route[0]) ? $_route[0] : null;
				$i = 0;
				// Find the longest non-regex substring and match it against the URI
				while (true) {
					if (!isset($_route[$i])) {
						break;
					} elseif (false === $regex) {
						$c = $n;
						$regex = $c === '[' || $c === '(' || $c === '.';
						if (false === $regex && false !== isset($_route[$i+1])) {
							$n = $_route[$i + 1];
							$regex = $n === '?' || $n === '+' || $n === '*' || $n === '{';
						}
						if (false === $regex && $c !== '/' && (!isset($requestUrl[$j]) || $c !== $requestUrl[$j])) {
							continue 2;
						}
						$j++;
					}
					$route .= $_route[$i++];
				}
				$regex = $this->compileRoute($route);
				$match = preg_match($regex, $requestUrl, $params);
			}
			if (($match == true || $match > 0)) {
				if ($params) {
					foreach ($params as $key => $value) {
						if (is_numeric($key)) unset($params[$key]);
					}
				}			
				$mm = array(
					'target' => $target,
					'params' => $params,
					'name' => $name
				);
				if ($match) {	
				  //we are going to change this to use all be in the router function
				  //break up the target at the @ symbol. first part is function second is the file 
				  $target = explode('@', $mm['target']);
				  $method = $target[0];
				  $class = "\\App\\Controllers\\".$target[1];
				  //include the source file
				  include $this->controllersDir . str_replace('\\', '/', $target[1]) . '.php';
				  //instantiate the class
				  $instance = new $class();
				  //this is where we will place our middleware. first check to see if the there is an alias in 
				  //the middleware array and then execute it against our controller.
				  //get the middleware array from the instance
				  $instanceMiddleware = $instance->getMiddleware();
				  $middleware = $this->getMiddleWareArray();
					//count the instance middleware array
					$middlewareCnt = count($instanceMiddleware);
				  $middlewareInstances = [];
				  //build an acceptible middleware list to send to relay
				  $i = 0;
				  foreach($instanceMiddleware as $val) {
				  	//then loop through the middleware and see if we have a match
					  foreach ($middleware as $key => $value) {
							if($val==$key) {
						  	//check if its an array if it is we have to add them to the container individually.
						  	$middlewareInstances[$i][]=$instanceMiddleware[$i];
						  	if (is_array($value)) {
						  		//first index is the middleware class and the second index is the plugin
						  		for($j=0;$j<count($value);$j++) {
						  			$middlewareInstances[$i][] = $value[$j];
					  				$i++;
						  		}
						  	} else {
						  		//just a middleware class. This class will extend from another and doesnt need the plugin portion
					  			$middlewareInstances[$i][] = $value;
					  			$i++;
						  	}
						  }
					  }
				  }
				  //get the request array
				if (defined('PHPUNIT_BETASYNTAX_TESTSUITE') == true) { 
					$requestMethod = $requestMethod;
				}
				// } else {
				// 	if($requestMethod === null) {
			 //  			$requestMethod = $_SERVER['REQUEST_METHOD'];	
				// 	} else {
				// 		$requestMethod = $_SERVER['REQUEST_METHOD'];
				// 	}
				// }
			  	//instantiate our request and response for Relay
			  	$request = new Request($requestMethod,$requestUrl);
			  	$response = new Response;
			  	$queue = [];
			  	//build the middleware queue
			  	for($i=0;$i<count($middlewareInstances);$i++) {
			  			$queue[] = $middlewareInstances[$i][1];
			  	}
			  	//setup the automatic resolver
					$resolver = function ($class) {
					    return new $class();
					};
					//build the Relay builder class
					$relayBuilder = new RelayBuilder($resolver);
					$relay = $relayBuilder->newInstance($queue);
					//run the middleware against our controller
					$response = $relay($request, $response);
					//finally if all our middleware passed on the response we can then run our intended controller action				
					if (!defined('PHPUNIT_BETASYNTAX_TESTSUITE') == true) { 
						$instance->$method($mm['params']);
					} 
					$this->routeFound=true;
				}
			}
		}
		if(!$this->routeFound) {
			if (defined('PHPUNIT_BETASYNTAX_TESTSUITE') == true) { 
				return true;
			} else {
				view('Errors/404.haml'); 	
			}
		} else {
			return false;
		}
	}
595053
protected function fromString($queryString)
    {
        if (empty($queryString)) {
            return $this;
        }

        $data = array();

        parse_str($queryString, $data);

        $this->fromArray($data);

        return $this;
    }
1082242
public function getParametersWithValue($requestValues)
    {
        // Final request parameters array
        $parameters = array();

        // Setting parameters
        foreach ($this->parameters as $paramKey => $paramDefaultValue) {
            // Overriding parameter value with the given one
            if (isset($requestValues[$paramKey]) && !empty($requestValues[$paramKey])) {
                $parameters[$paramKey] = $requestValues[$paramKey];
            } elseif (!empty($paramDefaultValue)) {
                $parameters[$paramKey] = $paramDefaultValue;
            }
        }

        // Returning populated array
        return $parameters;
    }
1291608
private function query($queryString = null)
    {
        $query = ($queryString == null) ? $this->query : $queryString;

        $this->statement = $this->_connection->prepare($query);
        $this->statement->execute();

        return $this;
    }
1080136
public function indexSearch($searchText, $maxResults)
    {
        // split the phrase into words
        $words = SearchAnalyser::analyse($searchText);
        if (!$words) {
            return [];
        }

        $query = $this->_em->createQueryBuilder()
            ->select('o')
            ->from($this->_entityName, 'o')
            ->setMaxResults($maxResults);

        $parameters = [];
        foreach ($words as $k => $word) {
            $subquery = $this->_em->createQueryBuilder()
                ->select("i$k.keyword")
                ->from($this->getSearchIndexClass(), "i$k")
                ->where("i$k.object = o")
                ->andWhere("i$k.keyword ILIKE :search$k");
            $query->andWhere($query->expr()->exists($subquery->getDql()));
            $parameters["search$k"] = '%' . $word . '%';
        }
        $query->setParameters($parameters);

        $results = $query->getQuery()->execute();

        return $results;
    }
1355209
private function searchValue(array $values = [], array $requestInputs = []) {
    foreach($values as $value) {
      if (!array_key_exists($value, $requestInputs)) {
        continue;
      }

      return $requestInputs[$value];
    }
    
    return null;
  }
190460
public final List<T> searchSorted(String searchString, String sort) {
        return this.findSortedByQuery(FULLTEXT_QUERY, sort, searchString);
    }