HSLE#52447 Zoeken in [faq_search, prodsearch en suggestfaq] vind alleen termen in fac_faq_hints als S(faq_search_hints_only) > 0, anders gewoon nog in fac_faq_hints, fac_faq_question en fac_faq_answer (default)

svn path=/Website/trunk/; revision=37510
This commit is contained in:
2018-03-27 14:08:03 +00:00
parent 27b0615034
commit bc91cdd879
3 changed files with 16 additions and 8 deletions

View File

@@ -114,13 +114,17 @@ function make_faq_list (searchtext, ororand)
if (ororand)
{
sql += " AND (" + fac.createOrOrClause("UPPER(fac_faq_question)", supper, wholeword)
+ " OR " + fac.createOrOrClause("UPPER(fac_faq_answer)", supper, wholeword)
+ " OR " + fac.createOrOrClause("UPPER(fac_faq_hint)", supper, 0, wholeword)+ ")";
sql += " AND (" + fac.createOrOrClause("UPPER(fac_faq_hint)", supper, 0, wholeword)
if (S("faq_search_hints_only") <= 0)
sql += " OR " + fac.createOrOrClause("UPPER(fac_faq_question)", supper, wholeword)
+ " OR " + fac.createOrOrClause("UPPER(fac_faq_answer)", supper, wholeword);
sql += ")";
}
else
{
sql += " AND " + fac.createOrClause2(["UPPER(fac_faq_question)","UPPER(fac_faq_answer)","UPPER(fac_faq_hint)"], supper, wholeword);
var fieldstrarr = ["UPPER(fac_faq_hint)"];
if (S("faq_search_hints_only") <= 0) fieldstrarr.push("UPPER(fac_faq_question)","UPPER(fac_faq_answer)");
sql += " AND " + fac.createOrClause2(fieldstrarr, supper, wholeword);
}
if (stdm_key_arr)

View File

@@ -408,6 +408,9 @@ function prodsearch_queries(write_discs, filter)
var authparamsBOF = user.checkAutorisation("WEB_FAQBOF", true); // ziet alles
var authparamsFOF = user.checkAutorisation("WEB_FAQFOF", true); // ziet ook FO-items
var authparamsUSE = user.checkAutorisation("WEB_FAQUSE", true); // ziet ook FO-items
var fieldstrarr = ["UPPER(fac_faq_hint)"];
if (S("faq_search_hints_only") <= 0) fieldstrarr.push("UPPER(fac_faq_question)","UPPER(fac_faq_answer)");
fsql = "SELECT ff.fac_faq_key product_key,"
+ " ff.fac_faq_question product,"
+ " 'faq' soort,"
@@ -420,7 +423,7 @@ function prodsearch_queries(write_discs, filter)
+ " ff.fac_faq_url xurl,"
+ " NULL foto"
+ " FROM fac_faq ff"
+ " WHERE " + fac.createOrClause2(["UPPER(fac_faq_question)","UPPER(fac_faq_answer)","UPPER(fac_faq_hint)"], supper)
+ " WHERE " + fac.createOrClause2(fieldstrarr, supper)
+ " AND ROWNUM < " + S("faq_max_results")
+ " AND (ff.fac_faq_lang = " + safe.quoted_sql(user.lang()) + " OR ff.fac_faq_lang IS NULL)"
+ " AND ff.fac_faq_datum < SYSDATE"; // zelf ingevoerd zie je hier niet per se terug

View File

@@ -28,13 +28,14 @@ chars = chars.replace(/\*/g,"%");
var extraInf = ", 'Extra' extra";
var fieldstrarr = ["UPPER(fac_faq_hint)"];
if (S("faq_search_hints_only") <= 0) fieldstrarr.push("UPPER(fac_faq_question)","UPPER(fac_faq_answer)");
// Check if person is authorized for all accounts
sql = " SELECT " + safe.quoted_sql(chars) + " zoekstr, to_char(count(*))||' resultaten' n"
+ " FROM fac_faq WHERE "
+ (!fronto? " fac_faq_level < 2 AND " : "")
+ fac.createOrClause("UPPER(fac_faq_question)", upperchars)
+ " OR "
+ fac.createOrClause("UPPER(fac_faq_answer)", upperchars)
+ fac.createOrClause2(fieldstrarr, upperchars)
+ " ORDER BY fac_faq_rank DESC NULLS LAST"
+ " , fac_faq_datum DESC"
+ " , fac_faq_question";