Skip to content

Instantly share code, notes, and snippets.

Stop Words
In search parlance, a “stopword” is a word that’s so common that adding it to a query rarely
increases the quality of results, and frequently decreases it. For example, if you did a search for
“the City of Chicago”, “Chicago” would certainly provide good results. “City” might as well. But
how many billions of documents that have nothing to do with Chicago contain the words “the”
and “of”?
Fortunately, LucidWorks Search understands the concepts of stopwords, and in most cases,
will eliminate them from your query. It also understands how to handle stop words on the back
end so that they help improve relevance (for example, by judging the proximity of two words)
rather than hinder it.
Tasks
/admin/rights/authItem/tasks
Operations
/admin/rights/authItem/operations
return !Yii::app()->user->isGuest;
mysqldump --opt --quote-names --skip-set-charset --default-character-set=latin1 mydatabase > /tmp/dump.sql
mysql --default-character-set=utf8 mydatabase < /tmp/dump.sql
explain select m.manufacturer_id, IFNULL(md.name, md2.name) from manufacturer m left outer join manufacturer_description md ON m.manufacturer_id = md.manufacturer_id AND md.language_id = 8 join manufacturer_description md2 ON m.manufacturer_id = md2.manufacturer_id AND md2.language_id = 1;
$luceneQueryString = sprintf('category_id_l:%s', $categoryId);
$queryObj = new SolrQuery();
$queryObj->setQuery($luceneQueryString);
$queryObj->addSortField("id", SolrQuery::ORDER_DESC);
$offset = Yii::app()->getRequest()->getParam('page', 0);
$queryObj->setStart($offset);
$queryObj->setRows(10);
$queryResponse = Yii::app()->lucene->getSearcher()->query($queryObj);
$result = $queryResponse->getResponse();
@damour
damour / tree
Last active December 19, 2015 15:39
$(".breadcrumbs").append("<span id='ajaxq-bread'></span>");
$('#treeview').bind('tree.click', function(event){
var myNode = event.node;
var myArray = new Array();
var divBred = "<div class='separator'></div>";
var ajaxqBread = $('#ajaxq-bread');
while(myNode !== null) {
if(myNode.name !== undefined) {
@damour
damour / FeatureGroupNewController.php
Created July 8, 2013 12:03
yii ajax validation controller
protected function performAjaxValidation($model)
{
if (isset($_POST['ajax']) && $_POST['ajax'] === 'user-form') {
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
@damour
damour / index.php
Created July 1, 2013 07:17
yii index.php autocomplete
class Yii extends YiiBase {
/**
* @static
* @return CWebApplication
*/
public static function app()
{
return parent::app();
}
}
@damour
damour / SmartFilter.php
Created June 27, 2013 12:23
getFilterProductsOld
/**
* Возвращает товары, которые подпадают под фильтр
*
* @param $smart_filter_id
* @return mixed
*/
public function getFilterProductsOld($smart_filter_id)
{
$model = self::model()->findByPk($smart_filter_id);