src/SearchElastic/Search.php
public function search($query)
    {
        $this->validate($query);
        $client = $this->client->getClient();
        $result = array();
        // Change the match column name with the column name you want to search in it.
        $params = [
                'index' => $this->client->getIndex(),
                'type'  => $this->client->getType(),
                'body'  => [
                    'query' => [
                        'match' => [ $this->searchColumn => $query],
                    ],
                ],
            ];
        $query  = $client->search($params);
            
        return  $this->extractResult($query);
    }
public function search($query)
    {
        $this->validate($query);
        $client = $this->client->getClient();
        $result = array();
        // Change the match column name with the column name you want to search in it.
        $params = [
                'index' => $this->client->getIndex(),
                'type'  => $this->client->getType(),
                'body'  => [
                    'query' => [
                        'match' => [ $this->searchColumn => $query],
                    ],
                ],
            ];
        $query  = $client->search($params);
            
        return  $this->extractResult($query);
    }
public function search ( $ query ) { $ this -> validate ( $ query ) ; $ client = $ this -> client -> getClient ( ) ; $ result = array ( ) ; // Change the match column name with the column name you want to search in it. $ params = [ 'index' => $ this -> client -> getIndex ( ) , 'type' => $ this -> client -> getType ( ) , 'body' => [ 'query' => [ 'match' => [ $ this -> searchColumn => $ query ] , ] , ] , ] ; $ query = $ client -> search ( $ params ) ; return $ this -> extractResult ( $ query ) ; }
Search in Elasticsearch.

@param  string  $query
@return Result from elasticsearch
Search in Elasticsearch .