BigCommerce - Hosted Ecommerce Software by Interspire

Interspire Forum

 
Go Back   Interspire Forum > Interspire Knowledge Manager Community Forum > Customization and Integration

 
 
Thread Tools Display Modes
  #1  
Old 12-29-2011, 09:25 PM
nedit + nedit is offline
Interspire Customer
 
Join Date: Dec 2011
Posts: 6
Default mysql search algorithm revelance "fix"

We had a problem where search results were sorted by nothing more than last update date.

Using boolean - fulltext search I was able to make the following changes to get it working as I think it was intended.


--class.search.parent.php--
inside the questFullTextSearch function:

comment this out (line ~58)
$orderBy = ' q.questionid ';

update this (line ~87)
$orderBy = ' score DESC , '. $orderBy;
to
$orderBy = ' score DESC ';

uncomment and change this line (line ~409)
//$query .= "\n ORDER BY $orderBy DESC ";
to
$query .= "\n ORDER BY $orderBy ";

comment out this line (line ~410)
$query .= "\n ORDER BY lastupdated DESC ";


That should get your search working a lot better. Without these changes it really doesn't work at all with mysql.


I went a step further and added a preference that articles with search words in the title were given preference in sort order. I can post those steps too if anyone is interested.
  #2  
Old 10-04-2012, 04:32 PM
lmhe
Guest
 
Posts: n/a
Default Thanks...

Worked for me, thanks. I wonder if anyone edited this class to give articles a higher score which have keyword(s) in the title?

Although this post is a litte old I'd really like to see those additional steps to give higher priority for articles with query words in the meta tags
  #3  
Old 10-04-2012, 06:13 PM
nedit + nedit is offline
Interspire Customer
 
Join Date: Dec 2011
Posts: 6
Default

Quote:
Originally Posted by lmhe View Post
Worked for me, thanks. I wonder if anyone edited this class to give articles a higher score which have keyword(s) in the title?

Although this post is a litte old I'd really like to see those additional steps to give higher priority for articles with query words in the meta tags
https://www.interspire.com/forum/showthread.php?t=18570

My last post there describes how I gave extra weight to keywords that were matched in the title. It was awhile ago but I think metawords do actually get extra weight as well by default.

Also not documented is the ability for you to add custom CSS to the search words. I set mine to highlight the words they searched for in the results page.
You can use the res_word (and res_word_2+) classes for custom css.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump