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

Reply
 
Thread Tools Display Modes
  #311  
Old 03-19-2007, 09:26 PM
eoc_Jason's Avatar
eoc_Jason eoc_Jason is offline
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for all that info! I'm about to head home for the day but I will definitly re-read it more thoroughly later tonight.
Reply With Quote
  #312  
Old 03-20-2007, 02:05 AM
eoc_Jason's Avatar
eoc_Jason eoc_Jason is offline
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I made some headway after reading through this entire thread...

First I had the issue with the coventry error, since I don't use it I just commented out the code as a quick fix for now.

Then I started getting the assert error if I searched a different time frame from the default (ex: a week ago and newer). So I added the assert_options as another quick fix.

What was bugging me the most was my dates were not being sorted properly, and upon digging through the code I discovered why...

First, in your sphinx.conf file's "post_src" (whatever you name it - it's the first bracket code), in the sql_query you need to add lastpost to the end of the SELECT. Then below the existing sql_date_column line, add another saying sql_date_column = lastpost. You will also need to add the lastpost to the SELECT in the delta code (next bracket code bit).

Rebuild your indexes completely...

Then in the sphinx.php file you will notice the sort_date defaults to 'dateline', and in the 'titleonly' if/else statement it changes to 'lastpost'. The "else" part of that statement refers to all queries that searches the entire posts - which can return as either posts or threads. So basically within the 'else' code (like after the set weights) just add:

PHP Code:
        if ($vbulletin->GPC['showposts'] == false)
        {
                
$sphinx_sort_by_date 'lastpost';
        } 
So now when results are returned as threads, it sorts them based on the last post date, not the date when the post with the matching word was found.

As promised, I'm attaching my sphinx.conf file that works with MySQL 4.0.x (because that version does not support sub-selects). I also have the above mentioned changes if you don't fully understand what I was trying to explain above. Included too is my stopwords file (it's just the MySQL default list).

Tomorrow I'm going to try and go through and ensure all the current functionality works with all the various search options, then I'm going to slowly try and work my way through to add the features that were removed from the vB template.
Attached Files
File Type: txt sphinx.conf.txt (6.3 KB, 36 views)
File Type: txt stopwords.txt (4.0 KB, 40 views)
Reply With Quote
  #313  
Old 03-20-2007, 07:27 AM
kmike kmike is offline
 
Join Date: Oct 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem with adding the "lastpost" to the attributes is that it will only be accurate immediately after reindexing. On a sufficiently busy forum, with frequently updated threads, the sorting by lastpost may be off by large amount just a few hours after full reindexing.
Though it's something you can live with if the forum isn't very active.
Reply With Quote
  #314  
Old 03-20-2007, 01:51 PM
eoc_Jason's Avatar
eoc_Jason eoc_Jason is offline
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ooo... you are right, I guess that's what I get for the late night coding. Boy, that is a pickle, since the delta only adds new posts & threads there is no way to go back and update the existing data (without a full reindex).

If only there was a way to query the mysql table to grab the latest post/thread attributes based on the sphinx results. I haven't fully examined the code so I don't know what all is and isn't possible yet.

Thanks for pointing out my oversight...
Reply With Quote
  #315  
Old 03-20-2007, 09:34 PM
kmike kmike is offline
 
Join Date: Oct 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I outlined the solution to this problem in the post #306:
https://vborg.vbsupport.ru/showpost....&postcount=306
Reply With Quote
  #316  
Old 03-22-2007, 08:20 AM
kmike kmike is offline
 
Join Date: Oct 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mute View Post
Did anyone else upgrade to php 5.2.1 and have their sphinx install break? I haven't had time to look into it yet, but mine fails to return results and I'm getting a:

Query '' retrieved -2114543231 of 1 matches in -2147483.222 sec.

Heh.

Hm. It is definitely something PHP 5.2.1 related. I went back to 5.2.0 and it is working just fine. I guess I'll have to look at the changelog in the morning to see if I can figure out what is wrong.
It's because of the bug in unpack() function in PHP 5.2.1:
http://bugs.php.net/bug.php?id=40749
First seen here, workaround included:
http://www.sphinxsearch.com/forum/vi...=340&from=1887
Reply With Quote
  #317  
Old 03-22-2007, 10:09 AM
mute mute is offline
 
Join Date: Dec 2002
Location: Phoenixville, PA
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kmike View Post
It's because of the bug in unpack() function in PHP 5.2.1:
http://bugs.php.net/bug.php?id=40749
First seen here, workaround included:
http://www.sphinxsearch.com/forum/vi...=340&from=1887
Yeah, shoban and I figured out what the problem was, he was contacting the PHP guys to yell at them who claim it "is not a bug". I hadn't seen the workaround though, thanks!
Reply With Quote
  #318  
Old 03-23-2007, 05:48 PM
eoc_Jason's Avatar
eoc_Jason eoc_Jason is offline
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

kmike - Yep, that worked perfectly.

The more I look at the sphinx.php code, the more I think overall functionality would be better just to merge the code in with the search.php file, then I think all stock vB functionality could be brought back. I'm going to tackle this on Sunday as I have some other things I need to take care of today and tomorrow I've got plans.
Reply With Quote
  #319  
Old 04-06-2007, 07:53 AM
kmike kmike is offline
 
Join Date: Oct 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sphinx 0.9.7 has been released:
http://www.sphinxsearch.com/doc.html#changelog
It fixes the crashes in the excerpts bulding routines and also the memory fragmentation problem. A host of new features are added, too.
Reply With Quote
  #320  
Old 04-06-2007, 04:46 PM
jason|xoxide jason|xoxide is offline
 
Join Date: Jul 2006
Location: Exton, PA
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kmike View Post
Sphinx 0.9.7 has been released:
http://www.sphinxsearch.com/doc.html#changelog
It fixes the crashes in the excerpts bulding routines and also the memory fragmentation problem. A host of new features are added, too.
Have you upgraded yet? Any issues? If I do upgrade from RC2, do I need to copy sphinxapi.php to all of my sites again or hasn't it changed?
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 11:58 PM.


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.06851 seconds
  • Memory Usage 2,286KB
  • Queries Executed 12 (?)
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
  • (1)bbcode_php
  • (3)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
  • (3)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
  • (2)postbit_attachment
  • (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_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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete