nqxcode / laravel-lucene-search

Laravel 4.2, 5.* package for full-text search over Eloquent models based on ZF2 Lucene.
73 stars 28 forks source link

Call to undefined method Nqxcode\LuceneSearch\Search::query() #36

Closed dbr0 closed 8 years ago

dbr0 commented 8 years ago

What I'm trying to do is run this method

dd(Search::query($request->q))

in my controller. At the top I have:

use Nqxcode\LuceneSearch\Search;

I believe I've followed everything correctly but I get the error from the title.

Also there isn't a query() method here:

https://github.com/nqxcode/laravel-lucene-search/blob/master/src/Nqxcode/LuceneSearch/Search.php

which is why I'm getting the error.

What am I doing wrong?

search:rebuild --verbose passed as complete

nqxcode commented 8 years ago

You should write use Nqxcode\LuceneSearch\Facade as Search; instead of use Nqxcode\LuceneSearch\Search;. Also you can write use Search; for case if you add necessary alias in config/app.php

dbr0 commented 8 years ago

Thank you very much, this return the builder. Hopefully I can proceed by myself from here but if you have a some good link to point me to it would be appreciated.