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

Reply
 
Thread Tools Display Modes
  #251  
Old 12-02-2006, 08:15 AM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You realize that there is a difference between sorting in 0.9.6 and 0.9.7-RC1? They are NOT compatible.
Reply With Quote
  #252  
Old 12-02-2006, 10:25 PM
mute mute is offline
 
Join Date: Dec 2002
Location: Phoenixville, PA
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DaiTengu View Post
Yeah, they're supposed to be sorted by date. Apparently I'm not the only person having the problem.
You aren't alone. We too seem to get out of order results when searching, and not sorting by relevance.
Reply With Quote
  #253  
Old 12-05-2006, 12:46 AM
mute mute is offline
 
Join Date: Dec 2002
Location: Phoenixville, PA
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any hope of Sphinx handling "Find all posts by user" searches?
Reply With Quote
  #254  
Old 12-05-2006, 05:31 AM
adalren adalren is offline
 
Join Date: May 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found a bug. When searching in title only, it doesn't honor datecut.

To fix, change:
PHP Code:
                // get posts from before $datecut
                
case 'before':
                        
$cl->SetFilterRange('dateline'0$datecut);
                        break;

                
// get posts from after $datecut
                
default:
                        
$cl->SetFilterRange('dateline'$datecut0xFFFFFFFF); 
to:
PHP Code:
                // get posts from before $datecut
                
case 'before':
                        
$cl->SetFilterRange($sphinx_sort_by_date0$datecut);
                        break;

                
// get posts from after $datecut
                
default:
                        
$cl->SetFilterRange($sphinx_sort_by_date$datecut0xFFFFFFFF); 
Another thing I found is that vb caches the search results and it tries to find the closest or exact match. There's no problem with exact matches, but when it saves the results sorted in ascending date order the subsequent searches in reverse order shows only old threads. To fix this, just comment out the $highScore = 1 & highScore = 2 lines in search.php. This disables using the stale cache for non-exact matches.

Thanks for the great hack orban!
Reply With Quote
  #255  
Old 12-15-2006, 02:42 PM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.sphinxsearch.com/index.html" target="_blank">http://www.sphinxsearch.com/index.html</a>

RC2 released, I'll upgrade tomorrow and see if there are any changes for us.

-----------

Recreated index, copied over new sphinxapi.php seems to work okay. There's a new "extended" search mode but don't think I'll use that (too complicated for users anyway).
Reply With Quote
  #256  
Old 12-19-2006, 05:56 PM
mute mute is offline
 
Join Date: Dec 2002
Location: Phoenixville, PA
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hm. So all was going well, but out of the blue our subforum searches stopped working. If i don't specify a subforum, the searches work. If I do, I get an assertion failure in sphinxapi.php @ line 290 (with 0.9.7-rc2).

I ran into the problem on -rc1, and decided to upgrade to see if it had been fixed, but it has not. I'm a tad stumped.

Edit: I seem to have fixed it by adding a "$value = intval($value);" before the assert() in sphinxapi.php. Guess this is related to the assertion failures earlier, so much for not having to cast variables
Reply With Quote
  #257  
Old 12-19-2006, 06:07 PM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tried to do an intval() on the forumid?
Reply With Quote
  #258  
Old 12-19-2006, 06:21 PM
amcd amcd is offline
 
Join Date: Oct 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@mute, good that you solved the problem, but i would not edit sphinxapi.php

since more people are facing the same problem, let me post an easy to follow solution. this is what i did to solve the problem on my forums, after reading the conversation between alanjay and orban

in includes/sphinx.php, around line 44, change

from:
Code:
	if ( count ( $sphinx_forumids ) > 0 ) $cl->SetFilter ( 'forumid', $sphinx_forumids );
	if ( count ( $sphinx_userids ) > 0 )  $cl->SetFilter ( 'postuserid', $sphinx_userids );
to
Code:
	if ( count ( $sphinx_forumids ) > 0 ) $cl->SetFilter ( 'forumid', intvalarray($sphinx_forumids) );
	if ( count ( $sphinx_userids ) > 0 )  $cl->SetFilter ( 'postuserid', intvalarray($sphinx_userids) );
around line 69, change

from
Code:
	if ( count ( $sphinx_forumids ) > 0 )    $cl->SetFilter ( 'forumid', $sphinx_forumids );
	if ( count ( $sphinx_threadids ) > 0 )   $cl->SetFilter ( 'threadid', $sphinx_threadids );
	if ( count ( $sphinx_userids ) > 0 )     $cl->SetFilter ( 'userid', $sphinx_userids );
	if ( count ( $sphinx_postuserids ) > 0 ) $cl->SetFilter ( 'postuserid', $sphinx_postuserids );
to
Code:
	if ( count ( $sphinx_forumids ) > 0 )    $cl->SetFilter ( 'forumid', intvalarray($sphinx_forumids) );
	if ( count ( $sphinx_threadids ) > 0 )   $cl->SetFilter ( 'threadid', intvalarray($sphinx_threadids) );
	if ( count ( $sphinx_userids ) > 0 )     $cl->SetFilter ( 'userid', intvalarray($sphinx_userids) );
	if ( count ( $sphinx_postuserids ) > 0 ) $cl->SetFilter ( 'postuserid', intvalarray($sphinx_postuserids) );
and lastly, around line 157, right at the end of the file, change

from
Code:
unset($cl, $res, $doc, $docinfo);
?>
to
Code:
unset($cl, $res, $doc, $docinfo);

// these functions added by me on 16 nov 06 to avoid assert failed errors from sphinxapi.php
function intvalarray($thearray)
{
	array_walk($thearray, "intvalitem");
	return $thearray;
}

function intvalitem(&$item, $key)
{
	$item = intval($item);
}

?>
Reply With Quote
  #259  
Old 12-19-2006, 06:41 PM
mute mute is offline
 
Join Date: Dec 2002
Location: Phoenixville, PA
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks amcd, that is indeed a better solution. I've made the changes and all appears to be working well
Reply With Quote
  #260  
Old 01-02-2007, 02:21 PM
ubuntu-geek ubuntu-geek is offline
 
Join Date: Oct 2004
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just out of curiosity.. Are people using the standard vb search or full text in conjunction with their sphinx implementations?
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:39 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.06237 seconds
  • Memory Usage 2,296KB
  • 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
  • (6)bbcode_code
  • (2)bbcode_php
  • (1)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
  • (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