Go Back   vb.org Archive > Community Discussions > Forum and Server Management
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #371  
Old 07-10-2007, 06:42 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by amcd View Post
this will not work in a multi-server setup.
True, I'm not there yet with multiple servers.
Use this instead:

Code:
$cl = new SphinxClient();
$cl->SetServer($sphinx_server, $sphinx_port);
$cl->SetLimits(0, $vbulletin->options['maxresults']);
$cl->SetMatchMode(SPH_MATCH_ALL);
...
$res = $cl->Query($vbulletin->GPC['query'] , $sphinx_index);
...
if (!is_array($res))
{
	$sphinxerror = $cl->GetLastError();
	if ($sphinxerror)
	{
		// server not running
	}
}
I run a failsafe on my server... if searchd is crashing, vbulletin search will take over automatically.

Edit: Let me dig into this more... I think that searchd will still spit an error, even if it's running, something like (no error).
I will post at sphinx site to ask Andrew how exacly the last error works.
Reply With Quote
  #372  
Old 07-13-2007, 06:41 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by raywjohnson View Post
When to run the indexer seems to be a matter of preference, keeping in mind the usage/size of the database in question. I run two (almost) identical crons, one every 20 min (for the deltas) and one every day (for the full index). The LOCKFILE helps to keep them from stepping on each other.

Code:
#!/bin/sh

LOCKFILE=/var/lock/sphinx.cron.lock
INDEXER_CONF=/usr/local/etc/sphinx.conf

# the lockfile is not meant to be perfect, it's just in case the
# two sphinx cron scripts get run close to each other to keep
# them from stepping on each other's toes.

[ -f $LOCKFILE ] && exit 0

trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT

touch $LOCKFILE

cd /usr/local/bin/ #(NOTE: this should be where indexer is located)

DELTAS_ONLY_LINE: ./indexer --config $INDEXER_CONF --rotate YOUR_POST_INDEX_DELTA YOUR_THREAD_INDEX_DELTA >/dev/null 2>&1
OR
FULL_INDEX_LINE ./indexer --all --rotate --config $INDEXER_CONF  >/dev/null 2>&1

exit 0
You could also replace ">/dev/null 2>&1" with "| mail -s "Sphinx Report" YOUR_EMAIL_HERE" to get an email of the output.

-RayJ
You should use lockrun instead, is way more robust then a shell script.
Reply With Quote
  #373  
Old 07-22-2007, 07:24 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Never mind, I sort it.
Reply With Quote
  #374  
Old 07-24-2007, 11:02 PM
PSS PSS is offline
 
Join Date: Jul 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I still would like to know: when you have Sphinx search in place, do you need to have FULLTEXT index(es) in Vbulletin at all?

Maybe it is a stupid question and FAQ and RTFM etc, but please take a second to answer yes or no if you know the answer, thanks!
Reply With Quote
  #375  
Old 07-24-2007, 11:12 PM
mute mute is offline
 
Join Date: Dec 2002
Location: Phoenixville, PA
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by PSS View Post
I still would like to know: when you have Sphinx search in place, do you need to have FULLTEXT index(es) in Vbulletin at all?

Maybe it is a stupid question and FAQ and RTFM etc, but please take a second to answer yes or no if you know the answer, thanks!
Nope.
Reply With Quote
  #376  
Old 07-25-2007, 06:07 AM
amcd amcd is offline
 
Join Date: Oct 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not only do you not need the fulltext indexes, but also that having them will not give you the full benefit of an external search solution as mysql will continue to spend (waste) time keeping them up to date.
Reply With Quote
  #377  
Old 07-25-2007, 07:53 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm amcd, you dropped the indexes? I never thought of that.
What exactly you guys did related to this issue? Thanks for your reply.
Reply With Quote
  #378  
Old 07-25-2007, 07:55 AM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TECK View Post
Hmmm amcd, you dropped the indexes? I never thought of that.
What exactly you guys did related to this issue? Thanks for your reply.
Dropping the indexes from the thread and post tables is one of the first things I did after installing sphinx.

Remember to close the forum while you drop the indexes but you should find that inserts to these tables are much faster.
Reply With Quote
  #379  
Old 07-25-2007, 08:12 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the info.
Can you post the queries?
Reply With Quote
  #380  
Old 07-25-2007, 08:17 AM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're using FULLTEXT MySQL search then the word table won't be being used. I'd truncate the word table rather than dropping it just in case.

FULLTEXT search works (from memory) using indexes on the thread and post tables. You can drop those two after cutting over to sphinx.

edit: nice edit there TECK while I was posting
Reply With Quote
Reply


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


All times are GMT. The time now is 01:49 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07328 seconds
  • Memory Usage 2,287KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete