Axivo Forums  

Go Back   Axivo Forums > vBulletin Zone > General Discussions

General Discussions General vBulletin discussions. ie. "How do I do this in vBulletin?", "Can this product do this?", "What does this feature do?", etc.

Reply
 
Thread Tools
  #1  
Old 07-24-2010, 07:00 PM
Spinball Spinball is offline
Axivo Client
 
Join Date: Feb 2009
Posts: 16
Spinball is on a distinguished road
Default Question about a similar threads search

Floren, see this modification for vBulletin?
http://www.vbulletin.org/forum/showthread.php?p=1711430
It's VERY useful for helping our members to avoid posting similar threads but only IF the similar thread search brings up the best results.
It currently uses jquery and the results are not brilliant.
Is there any way we can get it to use Searchlight to return better results, please?
__________________
Stuart Wright, http://www.AVForums.com
Reply With Quote
  #2  
Old 07-24-2010, 09:04 PM
Floren Floren is offline
Developer
 
Join Date: Feb 2009
Location: Montreal, Canada
Posts: 196
Floren is infamous around these parts
Default

I plan to write a product like that, once I'm done with the current project I work on.
Unfortunately, I cannot see the link but I presume that it will show you similar threads before you post one.
__________________
Floren Munteanu
Axivo Inc.
Please use the Requests Tracker, for sensitive data questions.
Reply With Quote
  #3  
Old 07-25-2010, 05:30 AM
Spinball Spinball is offline
Axivo Client
 
Join Date: Feb 2009
Posts: 16
Spinball is on a distinguished road
Default

This hack works pretty well. Just go to start a new thread, type something into the title text box and then lose focus from it.
Ajax shows a box similar to the standard similar threads box.
The query being used is:

Code:
$thread['similar'] = fetch_similar_threads($vbulletin->GPC['title']);
if ($vbulletin->options['similarthreadcheckactive'] == '1' AND $thread['similar'])
{
	// don't show similar threads from coventry
	if ($coventry = fetch_coventry('string'))
	{
		$globalignore = "AND thread.postuserid NOT IN ($coventry)";
	}
	else
	{
		$globalignore = '';
	}
	$hook_query_fields = $hook_query_joins = $hook_query_where = '';

$simthrds = $db->query_read_slave("
	SELECT thread.threadid, thread.forumid, thread.title, postusername, postuserid, thread.lastpost, thread.replycount, forum.title AS forumtitle
		" . iif($vbulletin->options['threadpreview'], ",post.pagetext AS preview") . "
		" . iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed") . "
		$hook_query_fields
	FROM " . TABLE_PREFIX . "thread AS thread
	INNER JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid)
	" . iif($vbulletin->options['threadpreview'], "LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.firstpostid)") . "
	" . iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " . TABLE_PREFIX . "subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = " . $vbulletin->userinfo['userid'] . " AND canview = 1)") . "
	$hook_query_joins
	WHERE thread.threadid IN ($thread[similar]) AND thread.visible = 1
		" . iif (($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) OR ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator']) OR can_moderate($forumid), '', "AND forum.password = ''") . "
		$globalignore
		$hook_query_where
	ORDER BY lastpost DESC
");
So it performs the standard vBulletin similar threads query and then applies another query on top. I guess to apply permissions.

fetch_similar_threads() is a function in the functions_search.php script which we have been using every time someone views a thread, so it would be a huge advantage in both performance and the quality of the results to put this through Searchlight.

I appreciate you are busy Floren and your implementation of this idea might be much nicer (I expect you might have a pop-up box like with the contextual search), but for the moment, is there a quick fix you can help me with to use Seachlight to perform the similar_threads query please?

Thanks
__________________
Stuart Wright, http://www.AVForums.com
Reply With Quote
  #4  
Old 07-25-2010, 05:33 AM
Floren Floren is offline
Developer
 
Join Date: Feb 2009
Location: Montreal, Canada
Posts: 196
Floren is infamous around these parts
Default

Ya, I want it to work like the current search keywords.
It will pop a dropdown list (like Google), the only difference is that it will make the line go directly to the thread.

In this way the overall design is nicer. I saw it in action at precentral.net and I did not like the fact that is shifts everything below, forcing users to lose focus on what they are typing. Obviously, it will be way faster with Searchlight. Right now, it takes a while until it pops the results. By the time you finished the thread title, you start writing the message and BAM... the screen is shifted way below because the added table.

As a side note, all fetch_similar_threads() related search queries are processed by Searchlight.
__________________
Floren Munteanu
Axivo Inc.
Please use the Requests Tracker, for sensitive data questions.
Reply With Quote
Reply

Thread Tools

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 Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about the Searchlight product hornstar Pre-Sale Inquiries 4 03-27-2010 01:34 AM


All times are GMT -4. The time now is 12:31 PM.


Copyright ©2006 - 2010 Axivo Inc.