Page 1 of 1

How to enable multiple keywords search

Posted: Fri Mar 30, 2012 1:40 am
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:
If more than one keywords is input in "Ask a question:", no result will return unless those two keywords are conjunction, that's mean if you search in kb with a article has "php scripts support system" in subject or content, then with the keywords "php support" seperate with space nothing return, "php scripts" will return one result.

I think it's better to enable more than one keywords search, at least two, those keywords can seperate with space or connect with "+" or "and".

Re: How to enable multiple keywords search

Posted: Fri Mar 30, 2012 12:16 pm
by Klemen
Add more articles to the knowledgebase and it should work better, because of the way how mysql fulltext search works (it ignores keywords under 4 chars and ignores keywords found in 50% of entries).

Re: How to enable multiple keywords search

Posted: Sat Mar 31, 2012 3:21 am
by deserteagle369
I think it's not the number of articles, I have more than 3000 articles in kb.

If two keywords seperate by space, there should be some code to handle the space like below:

Code: Select all

$arr=preg_split('/[\s,]+/',$query);
then do the query like this
SELECT * from hesk_kb_articles WHERE condition1 and condition2

Re: How to enable multiple keywords search

Posted: Sat Mar 31, 2012 8:23 am
by Klemen
If you do it like this you well either get even worse results or increase database load a lot if you add % around keywords.

Like said, fulltext search isn't perfect, but it works fine for most of the time. If you have problems with keyword "support" it's probably because it is included in too many articles. "PHP" would be ignored by the search because it is too short (unless you edit your MySQL configuration options to include shorter words).

Re: How to enable multiple keywords search

Posted: Thu Apr 05, 2012 7:40 am
by deserteagle369
sorry for confusion, my exaple is not good because "php" is less than 4 letters and "support" is too common.

My point is fullext of mysql can't work on Simple Chinese(also Japaness and Korea) because there is no space between the word like that in english, so mysql can not seperate the word to index in fulltext.

I try to find a way to work out for Simple Chinese, my plan is like this:

1. use fulltext in kb suggestion when user type in, because fulltext work in number and english, it will show some results;

2. use multiple keyword search in kb search when press "enter", if user input Simple Chinese, no suggestion article will show, but user press "enter" to start search, some article will show up.