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 10-05-2011, 08:02 PM
barb_s13 + barb_s13 is offline
Interspire Customer
 
Join Date: Sep 2011
Posts: 7
Default How to lessen the amount of related articles

How can we use meta keywords for our KB articles, so that it doesn’t always show the same ones at top of search results list?

Would it be best to use just one specific keyword per article?

Any suggestions would be greatly appreciated.

Last edited by barb_s13; 10-18-2011 at 09:24 PM.. Reason: Have not received a reply, trying to find answers.
  #2  
Old 12-30-2011, 08:14 PM
nedit + nedit is offline
Interspire Customer
 
Join Date: Dec 2011
Posts: 6
Default

Barb you are probably running into the same problem we did, where search results are sorted by nothing more than the last time the article was updated.
  #3  
Old 12-30-2011, 08:23 PM
barb_s13 + barb_s13 is offline
Interspire Customer
 
Join Date: Sep 2011
Posts: 7
Default

Thanks Nedit. Would you mind telling me what you did you do to fix the problem? It would be much appreciated.
  #4  
Old 12-30-2011, 08:37 PM
nedit + nedit is offline
Interspire Customer
 
Join Date: Dec 2011
Posts: 6
Default

Are you using mysql ? If so you can try the fix I propose in my other post on this forum.

If your not using mysql it will require a bit more effort to fix.
  #5  
Old 12-30-2011, 09:06 PM
barb_s13 + barb_s13 is offline
Interspire Customer
 
Join Date: Sep 2011
Posts: 7
Default Yes we do

We do use MySQL and I believe we used your workaround recently. Did it start like this: "Set default search type to "Fulltext searching" at Settings > Miscellaneous Settings. Edit file includes/classes/class.search.parent.php. Find the following lines (starting at around line 71):"

We had an issue when we tried this, and I wish I had more information on it, but it corrupted our database, but we were able to restore it. We still had the production copy on hand. We think it was because it was not done correctly or it was a coincidence, though. Have you heard of this happening if the code is not done correctly?

Thanks so much for your help.
  #6  
Old 12-30-2011, 09:21 PM
nedit + nedit is offline
Interspire Customer
 
Join Date: Dec 2011
Posts: 6
Default

What I did won't put your database in any risk whatsoever, you don't even need to touch it. Just the few short edits below (assuming you are using 5.1.5 like we are):

Make sure you set searching to boolean mode full text search so that it utilizes these changes.

This fix will allow mysql's boolean search to properly score articles and then display them in order of "score".

I also went one step further and made it so that if an article title contains search words its given precedence and will show up higher in the search results. (if you are interested in that lemme know)




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

comment this out (line ~58)
Code:
$orderBy = ' q.questionid ';
update this (line ~87)
Code:
$orderBy = ' score DESC , '. $orderBy;
to
Code:
$orderBy = ' score DESC ';
uncomment and change this line (line ~409)
Code:
//$query .= "\n ORDER BY $orderBy DESC ";
to
Code:
$query .= "\n ORDER BY $orderBy ";
comment out this line (line ~410)
Code:
$query .= "\n ORDER BY lastupdated DESC ";

Last edited by nedit; 12-30-2011 at 09:26 PM..
  #7  
Old 12-31-2011, 07:07 PM
barb_s13 + barb_s13 is offline
Interspire Customer
 
Join Date: Sep 2011
Posts: 7
Default

Yes, I am interested, thanks!
  #8  
Old 04-25-2012, 07:18 PM
matsuuran
Guest
 
Posts: n/a
Default

Hey nedit,

I don't know if you're still around, but I'd also be interested in hearing about how you accomplished that. Thanks
  #9  
Old 04-25-2012, 07:47 PM
nedit + nedit is offline
Interspire Customer
 
Join Date: Dec 2011
Posts: 6
Default

It's been awhile since I did it.
These are the notes I took at the time, hopefully it's still meaningful.

I should also mention that you can edit the default CSS so that the string you search for is highlighted/bolded on the results pages.




FILE CHANGE: knowledgemanager/includes/classes/class.search.parent.php

Add/Modify code line ~88:
Code:
if (!empty($this->searchString) && $GLOBALS['databaseType'] == 'mysql') {
$query .= ", ".$GLOBALS['AKB_DB']->FullText($fullTextFields, $this->searchString, $booleanmode).' as score';
New Line (After above code):
Code:
$query .= ", ".$GLOBALS['AKB_DB']->FullText($fullTextFields[0], $this->searchString, $booleanmode).' as title_score';
Altered Line (after above code):
Code:
$orderBy = ' score DESC, title_score DESC'; //. $orderBy;
Add code line ~286:
Code:
if (!empty($this->searchString) && $GLOBALS['databaseType'] == 'mysql') {
$query .= ", ".$GLOBALS['AKB_DB']->FullText($fullTextFields, $this->searchString, $booleanmode).' as score';
New Line (After above code):
Code:
$query .= ", ".$GLOBALS['AKB_DB']->FullText($fullTextFields[0], $this->searchString, $booleanmode).' as title_score';
Add code line ~403:
Code:
if (!empty($this->searchString) && $GLOBALS['databaseType'] == 'mysql') {
$query .= ", ".$GLOBALS['AKB_DB']->FullText($attachmentFullTextFields, $this->searchString, $booleanmode).' as score';
New Line (After above code):
Code:
$query .= ", \"0\" as title_score";
 

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