lib/Elastica/Search.php
public function search($query = '', $options = null)
    {
        $this->setOptionsAndQuery($options, $query);

        $query = $this->getQuery();
        $path = $this->getPath();

        $params = $this->getOptions();

        // Send scroll_id via raw HTTP body to handle cases of very large (> 4kb) ids.
        if ('_search/scroll' == $path) {
            $data = [self::OPTION_SCROLL_ID => $params[self::OPTION_SCROLL_ID]];
            unset($params[self::OPTION_SCROLL_ID]);
        } else {
            $data = $query->toArray();
        }

        $response = $this->getClient()->request(
            $path,
            Request::GET,
            $data,
            $params
        );

        return $this->_builder->buildResultSet($response, $query);
    }
public function search($query = '', $options = null)
    {
        $this->setOptionsAndQuery($options, $query);

        $query = $this->getQuery();
        $path = $this->getPath();

        $params = $this->getOptions();

        // Send scroll_id via raw HTTP body to handle cases of very large (> 4kb) ids.
        if ('_search/scroll' == $path) {
            $data = [self::OPTION_SCROLL_ID => $params[self::OPTION_SCROLL_ID]];
            unset($params[self::OPTION_SCROLL_ID]);
        } else {
            $data = $query->toArray();
        }

        $response = $this->getClient()->request(
            $path,
            Request::GET,
            $data,
            $params
        );

        return $this->_builder->buildResultSet($response, $query);
    }
public function search ( $ query = '' , $ options = null ) { $ this -> setOptionsAndQuery ( $ options , $ query ) ; $ query = $ this -> getQuery ( ) ; $ path = $ this -> getPath ( ) ; $ params = $ this -> getOptions ( ) ; // Send scroll_id via raw HTTP body to handle cases of very large (> 4kb) ids. if ( '_search/scroll' == $ path ) { $ data = [ self :: OPTION_SCROLL_ID => $ params [ self :: OPTION_SCROLL_ID ] ] ; unset ( $ params [ self :: OPTION_SCROLL_ID ] ) ; } else { $ data = $ query -> toArray ( ) ; } $ response = $ this -> getClient ( ) -> request ( $ path , Request :: GET , $ data , $ params ) ; return $ this -> _builder -> buildResultSet ( $ response , $ query ) ; }
Search in the set indices, types.

@param mixed     $query
@param int|array $options OPTIONAL Limit or associative array of options (option=>value)

@throws \Elastica\Exception\InvalidException

@return \Elastica\ResultSet
Search in the set indices types .