ESearch provides an action and some default views for search and order by relevance in MySQL without FULLTEXT.
protected/extensions/esearch//controllers/SiteController.php public function actions(){ return array( // ... 'search'=>array( 'class'=>'ext.esearch.SearchAction', 'model'=>'Post', 'attributes'=>array('title', 'tags', 'content'), ) ); }
//views/layout/main.php $this->widget('ext.search.SearchBoxPortlet'); //or SearchAction::renderInputBox(); //or $this->renderPartial('extensions/esearch/views/inputBox.php');
'import'=>array( // ... 'ext.esearch.*', ),
Total 8 comments
Excuse me but I am new to yii, can anybody tell me where exactly to put
thanks Jazz, I just commited it!
Please note that PHP 5.3 is required for this extension.
To fix it for PHP 5.2 find line #49 in SearchAction.php file:
and replace it with:
p.s. CGeorge please add "PHP 5.3" to "Requirements" section or add this fix to new release. thanks.
thanks b3atb0x, I just commited it!
Hey man, thank you - helped to save a lot of time. I had to add one tiny fix so searching by related models would work also:
After that specify 'with' parameter for that action in your controller
Thank you, arash, I just submited your changes to github! https://github.com/jorgebg/yii-esearch/issues/3
abajja, you can find an explanation at: http://r937.com/keyword_relevance.html
$_qsw must be defiend in SearchAction (you just used it for stopWords)
in SearchBoxPortlet, any use of $htmlOptions in init() should change with $this->htmlOptions
change "" with '' in $orders[] definition (SearchAction:129) to make extension also compatible with Postgresql. final code will be like this:
can you please explain whaht achieves this calculation:
Leave a comment
Please login to leave your comment.