Hello,
Thank you both for your interest in my problem.
Excuse my ignorance, but what do you mean by "core mod or as a plugin".
@patrickFromCroatia:
"$this->dao->where(sprintf("MATCH(d.s_title) AGAINST('%s' IN BOOLEAN MODE)", $this->sPattern) );"
with
"$this->dao->where(sprintf("MATCH(d.s_title) AGAINST('%s' IN BOOLEAN MODE)", $this->sPattern) );"
in oc-includes/osclass/model/Search.php may work
The two lines are identical, so I deleted "d.s_description" in my line of code, but it does not work.
Can you tell me exactly which files I have to intervene to do these tests?
But what if we use 'search_conditions' hook and change "sPattern" in theme files with something like "sKeyword" and then add this function:
Code: [Select]
<?php
function wm_search_keyword_title($params) {
foreach($params as $key => $value) {
switch($key) {
case 'sKeyword':
Search::newInstance()->join(DB_TABLE_PREFIX.'t_item_description as d','d.fk_i_item_id = '.DB_TABLE_PREFIX.'t_item.pk_i_id','LEFT');
Search::newInstance()->addConditions(sprintf("MATCH(d.s_title, d.s_description) AGAINST('%s' IN BOOLEAN MODE)", $value));
if(OC_ADMIN) {
$locale_code[osc_current_admin_locale()] = osc_current_admin_locale();
} else {
$locale_code[osc_current_user_locale()] = osc_current_user_locale();
}
$this->dao->where(sprintf("( d.fk_c_locale_code LIKE '%s' )", implode("' d.fk_c_locale_code LIKE '", $locale_code)));
break;
default:
break;
}
}
}
osc_add_hook('search_conditions', 'wm_search_keyword_title');
Thank you both again.