osTicket / osTicket-1.7

osTicket-1.7
GNU General Public License v2.0
232 stars 178 forks source link

Knowledgebase Search problem #44

Open mikhey54 opened 12 years ago

mikhey54 commented 12 years ago

When search selected any help topic and see all FAQ....

drewx0r commented 12 years ago

...there are no results. There should be results.

klimnad commented 12 years ago

because there is wrong code used: SELECT faq.faq_id, question FROM TABLE_YOUR_FAQ faq LEFT JOIN TABLE_YOUR_FAQ_CATEGORY cat USING(category_id) WHERE faq.ispublished=1 AND cat.ispublic=1 AND MATCH (question,answer,keywords) AGAINST ('ANYY SEARCH TEXT YOU MAY TRY TO USE') i was tested this sql construction - sorry guys this is not work in mysql - maybe i wrong but just try to build two or more questions in your table and use this string try to find the question and you will have the NULL results - if creators will correct it in /client/knowledgebase.inc.php in 59 then we all will be have working search :) I still have little experience to correct it myself :)

klimnad commented 12 years ago

ok guys and girls (i do not know who you are sorry) - i solve this with steps:

  1. open include/client/knowledgebase.inc.php and go to row 66
  2. REPLACE this code: $sql.=" AND MATCH(question,answer,keywords) AGAINST ('".db_input($_REQUEST['q'],false)."')"; With this code: $sql.=" AND question LIKE ('%".db_input($_REQUEST['q'],false)."%') OR answer LIKE ('%".db_input($_REQUEST['q'],false)."%') OR keywords LIKE ('%".db_input($_REQUEST['q'],false)."%')";
  3. save and ready.
  4. For normal search in admin panel also need to make changes in /include/staff/faq-categories.inc.php in row 64 REPLACE this code: $sql.=" AND MATCH(question,answer,keywords) AGAINST ('".db_input($_REQUEST['q'],false)."')"; With this code: $sql.=" AND question LIKE ('%".db_input($_REQUEST['q'],false)."%') OR answer LIKE ('%".db_input($_REQUEST['q'],false)."%') OR keywords LIKE ('%".db_input($_REQUEST['q'],false)."%')";
  5. Ready.