sadovojav / yii2-search-lucene

Yii search lucene
1 stars 3 forks source link

Class 'common\modules\news\models\News' not found #2

Open amirajlo opened 7 years ago

amirajlo commented 7 years ago

hi aleks i want use your extension i want indexing whene user click in search buttom i use below code in web.php in config folder

'search' => [ 'class' => 'sadovojav\search\components\SearchLucene', 'indexDirectory' => '@console/runtime/search', 'models' => [ [ 'dataProviderOptions' => [ 'query' => common\modules\news\models\News::find() ->localized('en') ->active() ], 'attributes' => [ 'lang' => 'en', // Custom fild to search 'name' => [ 'name' => SearchLucene::FIELD_TEXT ], 'text_intro' => [ 'text_intro' => SearchLucene::FIELD_UN_STORED ], 'text_full' => [ 'text_full' => SearchLucene::FIELD_UN_STORED ], ], ] ] ],

whene run app display error " Class 'common\modules\news\models\News' not found" even whene use "Class 'app\models\Product' not found".

sadovojav commented 7 years ago

This is for example: 'common\modules\news\models\News' You must use your Class for search. Check Product class in models directory

amirajlo commented 7 years ago

tanks aleks my product model work other page my product class ` namespace app\models; class Product extends \yii\db\ActiveRecord { }

` notice: whene use elasticsearch it gives same error and i dont know