This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Knowledge base search is kinda hit and miss


avatar
cosmin 269
From: -
Knowledge base search is kinda hit and miss

Sometimes it works and sometimes it doesn't.

it seems to always find words in the knowledgebase_question field, but not in knowledgebase_rawanswer, knowledgebase_answer, knowledgebase_description (at least not always).

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Knowledge base search is kinda hit and miss
avatar
Editor
0
From: -
Found the problem. Find in knowledgebaseresults.php:

                                                   if( !$knowledgebasesearch_titlesonly )


and replace with:

                                                      if( $knowledgebasesearch_titlesonly )
1 Re: Knowledge base search is kinda hit and miss
avatar
OP 269
From: -
still doesn't work.

-- phpMyAdmin SQL Dump

-- version 2.11.9
--  phpMyAdmin
--
-- Host: localhost
-- Generation Time: Dec 16, 2008 at 11:19 PM
-- Server version: 4.1.22
-- PHP Version: 4.4.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `yata19`
--

-- --------------------------------------------------------

--
-- Table structure for table `esselbach_ct_knowledgebase`
--

CREATE TABLE `esselbach_ct_knowledgebase` (
`knowledgebase_id` int(12) NOT NULL auto_increment,
`knowledgebase_author` varchar(255) NOT NULL default '',
`knowledgebase_website` smallint(4) default '0',
`knowledgebase_category` smallint(4) default '0',
`knowledgebase_question` varchar(255) NOT NULL default '',
`knowledgebase_seo` varchar(255) NOT NULL default '',
`knowledgebase_rawanswer` text,
`knowledgebase_answer` text,
`knowledgebase_description` text,
`knowledgebase_keywords` text,
`knowledgebase_tags` text,
`knowledgebase_comments` int(12) default '0',
`knowledgebase_allowcomments` tinyint(1) default '0',
`knowledgebase_thread` int(12) default '0',
`knowledgebase_html` tinyint(1) default '0',
`knowledgebase_smilies` tinyint(1) default '0',
`knowledgebase_code` tinyint(1) default '0',
`knowledgebase_status` tinyint(1) default '0',
`knowledgebase_password` varchar(255) default '',
`knowledgebase_position` int(12) NOT NULL default '1',
`knowledgebase_date` datetime NOT NULL default '0000-00-00 00:00:00',
`knowledgebase_fields` text,
`knowledgebase_views` int(12) default '0',
`knowledgebase_rating` mediumint(5) default '0',
`knowledgebase_votes` int(12) default '0',
`knowledgebase_activity` datetime NOT NULL default '0000-00-00 00:00:00',
`knowledgebase_postip` varchar(16) NOT NULL default '::1',
`knowledgebase_editip` varchar(16) NOT NULL default '::1',
`knowledgebase_editadmin` varchar(255) default '',
PRIMARY KEY (`knowledgebase_id`),
KEY `knowledgebase_website` (`knowledgebase_website`),
KEY `knowledgebase_category` (`knowledgebase_category`),
KEY `knowledgebase_seo` (`knowledgebase_seo`),
KEY `knowledgebase_tags` (`knowledgebase_tags`(255)),
KEY `knowledgebase_status` (`knowledgebase_status`),
KEY `knowledgebase_position` (`knowledgebase_position`),
KEY `knowledgebase_date` (`knowledgebase_date`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=109598 ;

--
-- Dumping data for table `esselbach_ct_knowledgebase`
--

INSERT INTO `esselbach_ct_knowledgebase` VALUES(69616, '', 0, 1, 'inconsequential', 'inconsequential', '1. neimportant etc. (vezi inconsequent 1.)\r\n2. (vezi) inconsequent 2 , 3.', '1. neimportant etc. (vezi inconsequent 1.)<br />2. (vezi) inconsequent 2 , 3.', '1. neimportant etc. (vezi inconsequent 1.) 2. (vezi) inconsequent 2 , 3....', 'inconsequent, neimportant', '', 0, 1, 0, 0, 0, 0, 0, '', 1, '2008-06-07 15:18:55', 'YWRqLg==||||||||||||||||||||||||', 0, 0, 0, '2008-06-07 15:18:55', '', '', 'admin');
INSERT INTO `esselbach_ct_knowledgebase` VALUES(109597, '', 0, 1, 'consequential', 'consequential', 'I. consecvent; II. important', 'I. consecvent; II. important', 'I. consecvent; II. important...', 'important', '', 0, 1, 0, 0, 0, 0, 0, '', 1, '2008-06-07 16:11:52', 'SS5hZGouIElJLmFkai4=||||||||||||||||||||||||', 11, 0, 0, '2008-06-07 16:11:52', '', '', 'admin');

Try searching for "consecvent" or "important". It will say 0 results. At least it does for me, even with this fix. I'm using 2008.1
1 Re: Knowledge base search is kinda hit and miss
avatar
Editor
0
From: -
I think I found the problem. Try changing the following in knowledgebaseresults.php:

                                                           $sql_search_query[ ] = "knowledgebase_question LIKE '%" . $database -> dbescape( $word ) . "%' OR knowledgebase_answer LIKE '%" . $database -> dbescape( $word ) . "%'";


in

                                                               $sql_search_query[ ] = "(knowledgebase_question LIKE '%" . $database -> dbescape( $word ) . "%' OR knowledgebase_rawanswer LIKE '%" . $database -> dbescape( $word ) . "%')";

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.