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

Restricting search to a set of models? #28

Closed mseymour closed 7 years ago

mseymour commented 8 years ago

Is it possible to restrict queries to a single model or set of models?

nqxcode commented 8 years ago

Please, describe your trouble in detail.

mseymour commented 8 years ago

Let's say that I have ModelA and ModelB. I want to search for "Foo", but only in ModelA, not in both models.

nqxcode commented 8 years ago

Unfortunately, you can't make it. But you can filter results by model class.

hendrasan commented 8 years ago

any example on this?

nqxcode commented 7 years ago

Added search method to SearchTrait that filter results by model class.