Page 1 of 1

how to change search in article like that in ticket

Posted: Mon Mar 12, 2012 2:47 pm
by deserteagle369
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

hesk2.3
mysql 5.414
database: hesk23 utf_general_ci
webpage encoding:gb2312

It work fine except kb search, very good software especially convert ticket to kb article, it save many time.

User can browser use IE and Firefox with defalut page encoding in GB2312, the ticket with subject and message in Chinese can be view correctly after submit, also correctly in mysql, export to excel 97-2003 also correct.

I imported ticket and article from xls file. so the content are same, that's mean "ticket subject"="article subject" and "ticket message"="article content".

The ticket and article are display well both for user and admin.

The problem is when use "Ask Question" search (hesk suggest kb search) :
For Chinese word: no article found
For number(more than 4 digits) or english word(more than 3 letters): some articles found,( but if search by subject or message in ticket, more and more result can be found). I have the same content of ticket and article as I said.

I know there is some weak for the mysql full text search, so I want to change the search in article, like that in ticket, how to do it?

appreciate for any comments or suggestion

eagle

Re: how to change search in article like that in ticket

Posted: Mon Mar 12, 2012 3:18 pm
by Klemen
In "knowledgebase.php" try changing

Code: Select all

MATCH(`subject`,`content`) AGAINST (\''.hesk_dbEscape($query).'\')
to

Code: Select all

(`subject` LIKE \'%'.hesk_dbEscape($query).'%\' OR `content` LIKE \'%'.hesk_dbEscape($query).'%\')
and see if that helps.

Note that you will need to turn off article suggestion, because this way no articles will be found as it will search for exact same words in subject/content. This code could only work if you type in Ask a question and click Search.

Re: how to change search in article like that in ticket

Posted: Wed Mar 14, 2012 12:44 am
by deserteagle369
It said:
( ! ) Parse error: syntax error, unexpected T_STRING in D:\wamp\www\hesk2.3\knowledgebase.php on line 203

Re: how to change search in article like that in ticket

Posted: Wed Mar 14, 2012 8:35 am
by Klemen
How about this:

Code: Select all

(`subject` LIKE \'%'.hesk_dbEscape($query).'%\' OR `content` LIKE \'%'.hesk_dbEscape($query).'%\')

Re: how to change search in article like that in ticket

Posted: Wed Mar 14, 2012 9:01 am
by deserteagle369
Great! It improved a lot.

when I type in "Ask a question:"

(I did turn off suggestion by set "Suggest KB articles: No", but it still work, I don't know why).

For english word, the suggestion show some articles(like 4) while keyin, more than ten times(like 50) article show after press "Enter";

so does number;

For Simple Chinese word, the suggestion show "No relevant articles found.", but press "Enter" or click "Search help", some articles showed.

I also changed knowledgebase_private.php to enable search for admin.

Re: how to change search in article like that in ticket

Posted: Wed Mar 14, 2012 9:35 am
by deserteagle369
The view entire knowledge base can just browse category one by one, if there many categories and subcategories it is not good.

I want a search form for knowledge base, user can select to search in which category, also search in "name", "emal", "subject" and "content", how to do it?

thanks.

eagle