Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search documents without specifying a column #87

Closed
vttn opened this issue Mar 20, 2016 · 2 comments
Closed

Search documents without specifying a column #87

vttn opened this issue Mar 20, 2016 · 2 comments

Comments

@vttn
Copy link

vttn commented Mar 20, 2016

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

 _search?q=Foo

I tried

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

Thanks

@lorenzo
Copy link
Member

lorenzo commented Mar 20, 2016

Use the _all column

@vttn
Copy link
Author

vttn commented Mar 20, 2016

$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

@vttn vttn closed this as completed Mar 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants