Why is the KB Search in V4 Absolutely Terrible?

Discussion in 'Using your helpdesk' started by Elite, Nov 30, 2010.

    • Kayako Staff

    Gary McGrath Kayako Staff

    Hi Sam,

    I think thats quite normal, the search is a "word search", its not doing "part of the word" but the full word. If you want to see what I mean, if you search for ppp* you will find it returns the KB articles. ( the star means "anything" )

    Gary
  1. Sironet New Member

    Thanks Gary.

    You are right, typing ppp* returned the KB articles, the fact is that no everybody knows about the star "*".
    Version 3 used to work much better searching articles, is there a way we can set the system no to have to add the star "*"
    The best is to make the search function show results of articles that contains the 3-4 or 5 letter or numbers user has typed i think.

    Sam.
    • Kayako Staff

    Gary McGrath Kayako Staff

    I am not the best at PHP, but it should be possible to make the search string always add a * on the end. I am just not sure where you would make that change to be honest. You might want to open a support ticket about it, they will be able to point you in the right direction.

    Gary
    • Kayako Staff

    Gary McGrath Kayako Staff

    I had a quick look and I did manage to find this,

    The file in question is in __swift\modules\base\client

    It's called class.Controller_Search.php

    find this code here: ( about line 83 )
    $_searchResultContainer = $this->SearchManager->Search($_POST['searchquery'], SWIFT::Get('usergroupid'));

    and replace with this code:
    $_searchResultContainer = $this->SearchManager->Search($_POST['searchquery'] . "*", SWIFT::Get('usergroupid'));

    Then rebuild your cache ( admin CP, diagnostics, rebuild cache )

    Then try your searches again.

    Gary

    N.B. Don't forget to backup your origional class.Controller_Search.php incase you need to revert the change.
  2. Sironet New Member

    Hi Gary.

    I have tested it replacing the code you mentioned and i can just say it's working perfectly, thanks mat for helping in sorting out this.
    Much apreciated.

    ;-)

    Sironet Soluciones
    Sironet LCD Screens (Computer LCD Screens & Chargers replacement for laptops)
    http://www.sironet.com/tienda
    • Kayako Staff

    Gary McGrath Kayako Staff

    Your welcome :D glad that got it fixed for you

    Gary
  3. Krafty Established Member

    Sighs....this still doesn't work for me!!!
    • Kayako Staff

    Gary McGrath Kayako Staff

    Krafty,

    What part is not working? can you explain more?

    Gary
  4. Krafty Established Member

    I copied in the fix you provided. Went through this topic to see if i was missing anything. I believe i've followed the steps as you explained it but no result.

    Still unable to find anything during the searches.
    • Kayako Staff

    Gary McGrath Kayako Staff

    Hi Krafty,

    If you are getting no results at all, then you will need to use this fix here:

    Run alter table query as follows: ( to ensure the table has fulltext index )
    ALTER TABLE `swsearchindex` ADD FULLTEXT (ft);

    then rebuild search index from Admin CP -> Options -> Knowledgebase -> Maintenance
    ^
    This is really important, KB articles are different to ticket indexing, make sure you run this rebuild from the admin CP
    Gary
  5. Krafty Established Member

    Ok, will get back to you for the usual props once i've done that.

    Thanks.
  6. Krafty Established Member

    Hey Gary,

    thanks. It now works. :D
    • Kayako Staff

    Gary McGrath Kayako Staff

    excellent :D

    Gary
  7. cyberneticos Reputed Member

    That worked for me, too :) Thanks Gary.
  8. jimmyneu Established Member

    I've tried everything and my searches still suck (mostly). I'm on .240.

    For example, I can't return any results for the term "email" in my support center. If I do the same search from within my Staff CP, it returns 4 pages of results!

    I checked and "email" isn't a SQL stop word...so why doesn't it work?
    • Kayako Staff

    Gary McGrath Kayako Staff

    Jimmy,

    In the client side support center, try searching for email* and see how that affects it?

    Gary
  9. jimmyneu Established Member

    Hi Gary,

    That actually returned 3 results (!). Better than none, but far from 4 pages...
    • Kayako Staff

    Gary McGrath Kayako Staff

    Jimmy,

    You might be getting more results from the staff CP simply as the staff have access to them all, whereas the client side can be limited depending on several permissions.

    It sounds to me like you are stuck like someone else was here with the fulltext search not bringing back part matches. I did post a fix for it, if your using self hosted, you can apply my fix, lemme know if your self hosted and I will hunt down the fix I made for it.

    Gary
  10. jimmyneu Established Member

    Hi Gary, yes, I'm self-hosted. I'd love to try your fix! Thanks!
    • Kayako Staff

    Gary McGrath Kayako Staff

    The file in question is in __swift\modules\base\client

    It's called class.Controller_Search.php

    Fix compatability: Self Hosted Yes / Kayako Hosted No

    find this code here: ( about line 83 )
    $_searchResultContainer = $this->SearchManager->Search($_POST['searchquery'], SWIFT::Get('usergroupid'));

    and replace with this code:
    $_searchResultContainer = $this->SearchManager->Search($_POST['searchquery'] . "*", SWIFT::Get('usergroupid'));

    Then rebuild your cache ( admin CP, diagnostics, rebuild cache )

    Then try your searches again.

    Gary

    N.B. Don't forget to backup your origional class.Controller_Search.php incase you need to revert the change.
    moba, rellZ and Cacchione like this.

Share This Page