cakephp / elastic-search

Elastic search datasource for CakePHP
Other
88 stars 53 forks source link

Search documents without specifying a column #87

Closed vttn closed 8 years ago

vttn commented 8 years ago

How can I search documents without specifying a column i.e.

 _search?q=Foo

I tried

$this->Businesses->find('all')->where(['*'=>'Foo']);

Thanks

lorenzo commented 8 years ago

Use the _all column

vttn commented 8 years ago
$q = 'Foo';
$businesses = $this->Businesses->find('all')->where(function ($builder) use($q) {
            return $builder->query(new \Elastica\Query\SimpleQueryString($q));
        }); 

acts more like _search/?q=Foo