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 09-16-2010, 12:06 PM
lrhogan + lrhogan is offline
Interspire Customer
 
Join Date: Jun 2010
Posts: 2
Default Order search results by most relevant

At the moment search results are returned in the order of last updated. I find this annoying because sometimes the most relevant result could come in 2 or 3 pages deep.

Anyone know a way of having the search results in the order of 'best match' rather than last updated?
  #2  
Old 10-26-2010, 02:36 PM
jmunger + jmunger is offline
Interspire Customer
 
Join Date: Oct 2010
Posts: 2
Default

lrhogan,

Have you found any solution to your question? If so, could you share? I am having the same issue.
  #3  
Old 10-26-2010, 03:00 PM
lrhogan + lrhogan is offline
Interspire Customer
 
Join Date: Jun 2010
Posts: 2
Default

Hey,

I ended up doing more of a work around. I modified the file \includes\classes\class.search.parent.php

Around line 840 you'l find the following code:

$template = " q.title LIKE '%".$GLOBALS['AKB_DB']->Quote($word)."%'
OR q.answer LIKE '%".$GLOBALS['AKB_DB']->Quote($word)."%'
OR q.metakeywords LIKE '%".$GLOBALS['AKB_DB']->Quote($word)."%' ";

I removed the middle line so it wouldnt return anything it matched in the answer. I just made sure anything that is related is in the meta keywords of the article.......

It still returns the results in order of last updated, but returns much fewer & only returns matches from the title name and keywords.

Its an improvement but not really a solution...

Line 454 of this php file is:

$orderBy = ' lastupdated ';

I have tried modifying this & its references but havnt been able to come up with anything useful as yet.
  #4  
Old 10-26-2010, 03:03 PM
jmunger + jmunger is offline
Interspire Customer
 
Join Date: Oct 2010
Posts: 2
Default

Thanks for the info!
  #5  
Old 11-19-2010, 06:01 PM
molte1mt + molte1mt is offline
Interspire Customer
 
Join Date: Nov 2010
Posts: 2
Default

Has anyone been able to make any progress on this? The search on my KB takes from 10-12 seconds, and does not return articles by relevance. I have been trying to modify the search.parent.php file, but cannot find a way to stop the search from returning articles by last updated.

At this point the search feature is useless, I need to find a way to return quicker results with more relevance....
  #6  
Old 11-22-2010, 08:09 PM
molte1mt + molte1mt is offline
Interspire Customer
 
Join Date: Nov 2010
Posts: 2
Default Update

Quote:
Originally Posted by molte1mt View Post
Has anyone been able to make any progress on this? The search on my KB takes from 10-12 seconds, and does not return articles by relevance. I have been trying to modify the search.parent.php file, but cannot find a way to stop the search from returning articles by last updated.

At this point the search feature is useless, I need to find a way to return quicker results with more relevance....
Update: I am now using the Keyword search, and changed the query to look for words in the title AND body of the article. I left the meta data line alone as I will enter unique words that will improve the placement of more relevant articles. I have gotten the search to return results within about 4 seconds. I am making a few steps forward, but it is no where near perfect.

Last edited by molte1mt; 11-22-2010 at 09:56 PM..
  #7  
Old 12-23-2010, 06:31 PM
cgod
Guest
 
Posts: n/a
Default

I found a way to get pretty good search results based on title and keywords, at least for our articles. There are three search modes, all of which have problems:

Keyword - Far too naive. Uses LIKE and orders by lastupdated. We found this to be mostly unusable.

Boolean mode fulltext - Broken in MySQL. It assigns a score of 1 to every row, so the good stuff will never rise to the top of the results.

Fulltext - Better than the other two, but far too many false-positives. Scoring the results works, but it matches against the body of the article as well, so generic terms yield a lot of highly irrelevant results which make it hard to find what you're looking for.

What we really wanted was a fulltext search that skipped over the article itself and relied solely on the keywords and title. It turns out this is pretty easy to do:

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):

Code:
$fullTextFields = array ('title', 'answer', 'metakeywords');
$rependingFullTextFields = array ('qh.title', 'qh.answer', 'qh    .metakeywords');
Remove the answer from both, leaving:

Code:
$fullTextFields = array ('title', 'metakeywords');
$rependingFullTextFields = array ('qh.title', 'qh.metakeywords');
Save the file.

Add indexes in MySQL on the title and metakeywords columns. This will require either access to a MySQL console or something like phpMyAdmin. I'm not familiar with the latter, so you're on your own there.

Code:
alter table ikm_questions_history add fulltext(title, metakeywords);
alter table ikm_questions add fulltext(title, metakeywords);
If you're like us, you have a lot of short search terms and acronyms. MySQL rejects any search term under four characters in length when doing fulltext searches, so a search for "abc manufacturing" will only search for "manufacturing". Fix that by editing your my.cnf:

Code:
[mysqld]
ft_min_word_len=3
Note: the [mysqld] section should already exist. Place the above line directly below it to be safe.

Restart MySQL so that the new word length rule takes effect.

That's it. Go test some searches against known keywords and see what sort of results you get now. Ours were substantially better.
 

Tags
order, results, search

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