Home Learn More Purchase Knowledge Base Support Contact

Community Forums

Forum » KBPublisher Code Hacks and Customization Discussion

KB 2.1

(5 posts)

  1. nidave
    Member

    I am using the free version of the script as an internal knowledge base within the office. (once I get the money I will pay for the latest version) however I want to change the way the searches are done. I want to just search through the meta keywords not the body of the article. I assume I need to change KBClientSearchModel.php and

    $sql = "
    SELECT
    e.*,
    SUBSTRING_INDEX(e.body,' ',70) AS body,

    I think the change needs to be
    SUBSTRING_INDEX(e.meta_keywords,' ',70) AS meta_keywords,

    I have no great knowledge with PHP and SQL so am making guesses.

    I would be very grateful for any help.
    Dave

    Posted 6 months ago #
  2. client/inc/KBClientSearchGenerator.php

    from
    $sql['select'] = "MATCH (e.title, e.body, e.meta_keywords, e.meta_description) AGAINST ('$str') AS score";
    $sql['where'] = "MATCH (e.title, e.body, e.meta_keywords, e.meta_description) AGAINST ('$str' IN BOOLEAN MODE)";

    to
    $sql['select'] = "MATCH (e.body) AGAINST ('$str') AS score";
    $sql['where'] = "MATCH (e.body) AGAINST ('$str' IN BOOLEAN MODE)";

    it will search only by body field

    Posted 6 months ago #
  3. nidave
    Member

    thanks very much. :)

    Posted 6 months ago #
  4. nidave
    Member

    Spoke too soon
    I keep getting
    Database error!
    It is possible server is overloaded. Try again or come back later.

    Posted 6 months ago #
  5. Ah, yes. You should add fulltext index on body field.

    Posted 6 months ago #

RSS feed for this topic

Reply

You must log in to post.

© 2008 Double Jade LLC | customer.service@kbpublisher.com