vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Forum and Server Management (https://vborg.vbsupport.ru/forumdisplay.php?f=232)
-   -   Sphinx and soft deletes (https://vborg.vbsupport.ru/showthread.php?t=198365)

LauraS 12-08-2008 08:08 PM

Sphinx and soft deletes
 
I'm having an issue with sphinx search when finding posts by a user. I have a thread that was marked as a soft delete (thread.visible = 2) but the posts inside that thread were not soft deleted (post.visible = 1). The problem I'm seeing is that if I then run a find post by user search those soft deleted posts don't show up in the output even though in the DB I can see that that postid is set to visible = 1. So I'm not really seeing ALL the posts for that user. Anybody experienced something like this?

Danny

LauraS 12-09-2008 08:59 PM

I think i found the solution to my problem. Seemed like for super mod, mod and admin account types soft deletes would still display using vbsearch when doing find post/thread by users but since sphinx does not index soft deletes they'd never show up on the output when converted to sphinx search. To remedy that I modified search_sphinx.php with the following:

near the top after

Code:

// admin only mode
#if ($vbulletin->userinfo['userid'] != 1) die('Search not available at the moment.');

// finduser
if ($_REQUEST['do'] == 'finduser')
{

I included

Code:

        // My code *******************************************************
        // Don't do sphinx search for admins, mods and super mods
        if ($vbulletin->userinfo['usergroupid'] == 5 || $vbulletin->userinfo['usergroupid'] == 6 || $vbulletin->userinfo['usergroupid'] == 7) {
                return true;
        }

        // Checking to see if user is member of admin, mod, super mods
        $ccGroupList = explode(",", $vbulletin->userinfo['membergroupids']);
        foreach($ccGroupList as $ccGroupID) {
                if ($ccGroupID == 5 || $ccGroupID == 6 || $ccGroupID == 7) {
                        return true;
                }               
        }
        // End of my code ***************************************************

        // search timer
        $searchstart = microtime();

Basically when either the usergroupid or membergroupids is or part of admin, mod, super mod accounts it exits out and uses normal vbsearch which for us is not a huge deal and seems to work.

Danny


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00920 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete