public function search(array $types, array $query, array $queryStringParams = [])
    {
        $params = [];
        $params['index'] = $this->getIndexName();
        
        $resolvedTypes = [];
        foreach ($types as $type) {
            $resolvedTypes[] = $this->resolveTypeName($type);
        }
        
        if (!empty($resolvedTypes)) {
            $params['type'] = implode(',', $resolvedTypes);
        }
        
        $params['body'] = $query;

        if (!empty($queryStringParams)) {
            $params = array_merge($queryStringParams, $params);
        }

        $this->stopwatch('start', 'search');
        $result = $this->client->search($params);
        $this->stopwatch('stop', 'search');

        return $result;
    }
public function search(array $types, array $query, array $queryStringParams = [])
    {
        $params = [];
        $params['index'] = $this->getIndexName();
        
        $resolvedTypes = [];
        foreach ($types as $type) {
            $resolvedTypes[] = $this->resolveTypeName($type);
        }
        
        if (!empty($resolvedTypes)) {
            $params['type'] = implode(',', $resolvedTypes);
        }
        
        $params['body'] = $query;

        if (!empty($queryStringParams)) {
            $params = array_merge($queryStringParams, $params);
        }

        $this->stopwatch('start', 'search');
        $result = $this->client->search($params);
        $this->stopwatch('stop', 'search');

        return $result;
    }
public function search ( array $ types , array $ query , array $ queryStringParams = [ ] ) { $ params = [ ] ; $ params [ 'index' ] = $ this -> getIndexName ( ) ; $ resolvedTypes = [ ] ; foreach ( $ types as $ type ) { $ resolvedTypes [ ] = $ this -> resolveTypeName ( $ type ) ; } if ( ! empty ( $ resolvedTypes ) ) { $ params [ 'type' ] = implode ( ',' , $ resolvedTypes ) ; } $ params [ 'body' ] = $ query ; if ( ! empty ( $ queryStringParams ) ) { $ params = array_merge ( $ queryStringParams , $ params ) ; } $ this -> stopwatch ( 'start' , 'search' ) ; $ result = $ this -> client -> search ( $ params ) ; $ this -> stopwatch ( 'stop' , 'search' ) ; return $ result ; }
Executes search query in the index.

@param array $types             List of types to search in.
@param array $query             Query to execute.
@param array $queryStringParams Query parameters.

@return array
Executes search query in the index .