Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 02 Feb 2015, 19:45
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Search not working after upgrade to vBulletin 4.2.2 Patch Level 4

Hello all,

After upgrading from 4.2.2 PL1 to 4.2.2 PL 4 the site searching no longer work, i.e. when users visit the following link (New Posts):

mysite.co.uk/search.php?do=getnew&contenttype=vBForum_Post

They following message:

Sorry, there are no new posts to view.

You may search for posts updated during the previous 24 hours, here
Also worth noting that the word 'here' in the message above links to:

mysite.co.uk/search.php?do=getdaily

and that results in the following message:

Sorry - no matches. Please try some different terms.
Worth noting that there definitely are new posts

As another example, the site is motorbike related so it is a word that is used very often. If I search 'motorbike' I get:

Sorry - no matches. Please try some different terms.
Queue Search Updates is set to yes and the scheduled job is active and set to trigger every 10 minutes. As per usual I have disabled all plugins and still get exactly the same behaviour. I have also run command line mysqlcheck against the DB and this has not highlighted any issues

Any ideas?

EDIT: When running mysqlcheck I did notice a number of tables I don't recall seeing before. All with names as follows (the number at the end changes):

taggregate_temp_1410699360

Is this potential and indication of a failed upgrade? i.e. temp tables being left behind?

Last edited by MrEyes; 02 Feb 2015 at 19:57.
Reply With Quote
  #2  
Old 02 Feb 2015, 20:27
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by MrEyes View Post
EDIT: When running mysqlcheck I did notice a number of tables I don't recall seeing before. All with names as follows (the number at the end changes):

taggregate_temp_1410699360

Is this potential and indication of a failed upgrade? i.e. temp tables being left behind?
Those are created by the scheduled task that updates thread view counts. They shouldn't really be hanging around, but it doesn't have to do with search or with upgrading.
Reply With Quote
  #3  
Old 03 Feb 2015, 13:12
Gio~Logist's Avatar
Gio~Logist Gio~Logist is offline
 
Join Date: Jun 2004
Location: San Francisco
Real name: Giovanni Martinez
Try rebuilding your search index and see if that helps. I would also clear my "searchlog" table if you're familiar with doing so.
__________________

ModernvB.com - vBulletin Mods & Services - ModernvB.com vBulletin 3 Mods - ModernvB.com vBulletin 4 Mods - Hire ModernvB
Full-Time vB Development - If you can think it, we can build it.
Reply With Quote
  #4  
Old 04 Feb 2015, 00:24
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Rightio, I have rebuilt the searchindexes using the command line utility as this is a mid to large site and doing this via ACP isn't really viable.

Unfortunately this made no difference, the problem still remains.

Regarding the suggestion of clearing the search log. Are you talking about done a delete from / truncate of the searchlog table? Fairly simple to do via SQL admin but thought it better to check before I wade in with a delete command

For reference, here is the output from the reindex:

[[email protected] temp]# php searchindex.php
PHP Warning: PHP Startup: apc.shm_size now uses M/G suffixes, please update your ini files in Unknown on line 0
Please enter the path to your vBulletin directory: /var/www/vhosts/mysite.co.uk/httpdocs/
Rebuild Search Index
--------------------
Note:
You should not normally need to empty the search index, however if items are showing in search results after they have been permanently deleted then emptying the index and rebuilding the search index will fix this. Search will not work correctly after emptying the index until the index is fully rebuilt.
Click Here to empty the search index.
Empty Index [0/1,Default=0]:

0) All
3) Forums
1) Posts
7) Groups
5) Group Messages
11) Visitor Messages
16) Blog Comments
15) Blog Entries
Content type to index [Default=0]: 0
Turn off DB indexes during rebuild [0/1,Default=0]: 0
Item id to start at [Default=0]:
Number of items to process per batch [Default=10000]:

Building Search Index Forums ...
IDs 0-140 ... Done (0.22 sec)
Building Search Index Forums: Done
Building Search Index Posts ...
IDs 0-10000 ... Done (26.08 sec)
IDs 10000-20000 ... Done (26.84 sec)
IDs 20000-30000 ... Done (25.90 sec)
<snip>
My SSH connection timed out at around 140k, so after logon I restarted the index at 140k - the only difference was that I set the rerun to use 1000 batches rather than 10000 as this made progress more obvious. The following is the last few lines of the output

IDs 2346000-2347000 ... Done (4.88 sec)
IDs 2347000-2348000 ... Done (2.38 sec)
IDs 2348000-2348538 ... Done (1.53 sec)
Building Search Index Posts: Done
Building Search Index Groups ...
Building Search Index Groups: Done
Building Search Index Group Messages ...
Building Search Index Group Messages: Done
Building Search Index Visitor Messages ...
Building Search Index Visitor Messages: Done
Building Search Index Blog Comments ...
Building Search Index Blog Comments: Done
Building Search Index Blog Entries ...
Building Search Index Blog Entries: Done
Building Search Index: 0 hours, 59 minutes and 00 seconds
Reply With Quote
  #5  
Old 04 Feb 2015, 04:10
edgeless edgeless is offline
 
Join Date: Mar 2013
Did you issue the REPAIR TABLE quick commands for searchcore_text and searchgroup_text, and then rebiuld the FULLTEXT indexes, and then drop the old indexes from the tables, and then create new FULLTEXT indexes for searchcore_text (title, keywordtext) and searchgroup_text (title)? That has worked for me in the past to straighten out various db search issues.
Reply With Quote
  #6  
Old 04 Feb 2015, 04:50
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Try disabling your server caching (apc?) and see if search works then.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #7  
Old 04 Feb 2015, 09:01
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Short story, still no worky

Long story....

I have stopped APC* by disabling at both PHP (via apc.ini and then restarting httpd) and also vBulletin (config.php). I also confirmed it was stopped by loading the APC admin panel and getting the following:

No cache info available. APC does not appear to be running.
I have also issued the following two SQL commands:

REPAIR TABLE searchcore_text QUICK
REPAIR TABLE searchgroup_text QUICK
Per SQL docs these should rebuild the full text indexes.

As mentioned, neither solution fixed the issue.

* As an APC related aside I have fixed the PHP warning warning that came up when running searchindex.php via the command line (i.e. PHP Warning: PHP Startup: apc.shm_size now uses M/G suffixes, please update your ini files in Unknown on line 0)
Reply With Quote
  #8  
Old 04 Feb 2015, 15:44
edgeless edgeless is offline
 
Join Date: Mar 2013
This is what has worked for me...

Temporarily turn off forum access from the vB ACP... at Settings > Turn Your vBulletin On and Off.

If you have modified full-text variables that affect indexing or changed the stopword file itself, you must rebuild your FULLTEXT indexes after making those changes and restarting the MySQL server.

To restart the MySQL server, use the following command:

service mysql restart

Next, log into a MySQL terminal session.

To rebuild the indexes it is usually sufficient to do a QUICK repair operation with:

mysql> REPAIR TABLE searchcore_text QUICK;
mysql> REPAIR TABLE searchgroup_text QUICK;

Next, restart the MySQL server again:

service mysql restart

Next, rebuild your FULLTEXT indexes. To rebuild your indexes, you need to run the follow queries in sequence...

But before doing so, emptying your search tables will speed things up. The queries to empty the tables are:

truncate searchcore;
truncate searchcore_text;
truncate searchgroup;
truncate searchgroup_text;


Next you need to drop the old indexes off the tables. To drop the indexes, use the following commands:

drop index text on searchcore_text;
drop index grouptitle on searchgroup_text;

Finally, you need to build new indexes. To recreate the specific indexes, use the following commands:

CREATE FULLTEXT INDEX text ON searchcore_text (title, keywordtext);
CREATE FULLTEXT INDEX grouptitle ON searchgroup_text (title);

You can then go to your vB ACP and do an interface-executed rebuild session from there. To do this, go to the Maintenance > General Update Tools section of your vBulletin ACP. You optionally may want to empty the indexes from there before starting the rebuild process.


Note: My search functionality wouldn't fully return until I did the following.

Go to the Maintenance > Repair / Optimize Tables section of your vBulletin ACP and optimize the post and thread word tables.

Next, you should probably then go to the Forums & Moderators > Forum Blocks Manager section of your vB ACP and click on Reload Block Types.

Finally, re-enable your general forum access from the vB ACP at Settings > Turn Your vBulletin On and Off.

Done.

--------------- Added 04 Feb 2015 at 16:15 ---------------

One more noteworthy observation... I have noticed that after performing the above steps, there has been a significant latency period before the search function returned to normal. I'm assuming that such 'lag' to gain back correct search functionality is related to size of the particular database and the processor speed of the hosting machine in conjunction and how quickly those elements can complete the necessary work to restructure the indexes for the entire database. But that's merely a guess on my part. The main point is that once you've performed the above steps, you may want to give it a bit of time before concluding that things haven't changed.
Reply With Quote
  #9  
Old 04 Feb 2015, 16:49
Gio~Logist's Avatar
Gio~Logist Gio~Logist is offline
 
Join Date: Jun 2004
Location: San Francisco
Real name: Giovanni Martinez
Wow, that's quite the headache. Glad you're finally sorted though
__________________

ModernvB.com - vBulletin Mods & Services - ModernvB.com vBulletin 3 Mods - ModernvB.com vBulletin 4 Mods - Hire ModernvB
Full-Time vB Development - If you can think it, we can build it.
Reply With Quote
  #10  
Old 07 Feb 2015, 20:06
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Had to wait for the weekend to try the above...

Drum roll please....

It didn't work, still the same issue as described above (for more info on the steps performed see below)

As a curious aside, one member was reporting that search was working for them. Turns out what they were doing was going into Advanced Search and under single content types selecting "show results as posts". Which is curious.

Originally Posted by Stuff I Did
Originally Posted by In vBulletin ACP
VB ACP -> Settings -> Options -> Turn Your vBulletin On and Off -> Turn site off
Originally Posted by SSH to Server
[[email protected] ~]# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]

[[email protected] ~]# mysql -h 127.0.0.1 -p -u USERNAME DATABASENAME
Enter password:

mysql> REPAIR TABLE searchcore_text QUICK;
+--------------------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+--------------------------------+--------+----------+----------+
| mydb.searchcore_text | repair | status | OK |
+--------------------------------+--------+----------+----------+
1 row in set (40.89 sec)

mysql> REPAIR TABLE searchgroup_text QUICK;
+---------------------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+---------------------------------+--------+----------+----------+
| mydb.searchgroup_text | repair | status | OK |
+---------------------------------+--------+----------+----------+
1 row in set (0.10 sec)

mysql> exit
Bye
[[email protected] ~]# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]

[[email protected] ~]# mysql -h 127.0.0.1 -p -u USERNAME DATABASENAME
Enter password:

mysql> truncate searchcore;
Query OK, 0 rows affected (0.00 sec)

mysql> truncate searchcore_text;
Query OK, 0 rows affected (0.11 sec)

mysql> truncate searchgroup;
Query OK, 0 rows affected (0.01 sec)

mysql> truncate searchgroup_text;
Query OK, 0 rows affected (0.00 sec)

mysql> drop index text on searchcore_text;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> drop index grouptitle on searchgroup_text;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> CREATE FULLTEXT INDEX text ON searchcore_text (title, keywordtext);
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> CREATE FULLTEXT INDEX grouptitle ON searchgroup_text (title);
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> exit
Bye

[[email protected]]# php searchindex.php
Please enter the path to your vBulletin directory: /var/www/vhosts/mysite.co.uk/httpdocs/
Rebuild Search Index
--------------------
Note:
You should not normally need to empty the search index, however if items are showing in search results after they have been permanently deleted then emptying the index and rebuilding the search index will fix this. Search will not work correctly after emptying the index until the index is fully rebuilt.
Click Here to empty the search index.
Empty Index [0/1,Default=0]: 1

0) All
3) Forums
1) Posts
7) Groups
5) Group Messages
11) Visitor Messages
16) Blog Comments
15) Blog Entries
Content type to index [Default=0]: 0
Turn off DB indexes during rebuild [0/1,Default=0]: 0
Item id to start at [Default=0]: 0
Number of items to process per batch [Default=10000]: 1000

Building Search Index Forums ...
IDs 0-140 ... Done (0.11 sec)
Building Search Index Forums: Done
Building Search Index Posts ...
IDs 0-1000 ... Done (2.94 sec)
IDs 1000-2000 ... Done (2.44 sec)
IDs 2000-3000 ... Done (2.61 sec)
IDs 3000-4000 ... Done (2.97 sec)
<SNIP SNIP SNIP>
<SNIP SNIP SNIP>
<SNIP SNIP SNIP>
<SNIP SNIP SNIP>
<SNIP SNIP SNIP>
IDs 2347000-2348000 ... Done (3.50 sec)
IDs 2348000-2349000 ... Done (3.88 sec)
IDs 2349000-2350000 ... Done (2.75 sec)
IDs 2350000-2350784 ... Done (2.58 sec)
Building Search Index Posts: Done
Building Search Index Groups ...
IDs 0-48 ... Done (0.14 sec)
Building Search Index Groups: Done
Building Search Index Group Messages ...
IDs 0-1000 ... Done (3.30 sec)
IDs 1000-2000 ... Done (3.14 sec)
IDs 2000-3000 ... Done (3.87 sec)
IDs 3000-4000 ... Done (3.48 sec)
IDs 4000-5000 ... Done (2.17 sec)
IDs 5000-6000 ... Done (3.24 sec)
IDs 6000-7000 ... Done (3.05 sec)
IDs 7000-8000 ... Done (1.84 sec)
IDs 8000-9000 ... Done (3.54 sec)
IDs 9000-9584 ... Done (0.33 sec)
Building Search Index Group Messages: Done
Building Search Index Visitor Messages ...
IDs 0-1000 ... Done (3.10 sec)
IDs 1000-2000 ... Done (3.42 sec)
IDs 2000-3000 ... Done (3.36 sec)
IDs 3000-3882 ... Done (2.81 sec)
Building Search Index Visitor Messages: Done
Building Search Index Blog Comments ...
IDs 0-1000 ... Done (0.85 sec)
IDs 1000-2000 ... Done (1.13 sec)
IDs 2000-3000 ... Done (3.13 sec)
IDs 3000-3345 ... Done (0.83 sec)
Building Search Index Blog Comments: Done
Building Search Index Blog Entries ...
IDs 0-1000 ... Done (2.89 sec)
IDs 1000-1265 ... Done (0.94 sec)
Building Search Index Blog Entries: Done
Building Search Index: 2 hours, 22 minutes and 35 seconds
[[email protected]]#
Originally Posted by In vBulletin ACP
VB ACP -> Maintenance -> Repair / Optimize Tables -> Select POST table -> Continue
post Check Status: OK
post Optimize Status: OK

VB ACP -> Maintenance -> Repair / Optimize Tables -> Select all thread tables -> Continue
thread Check Status: OK
thread Optimize Status: OK
thread_serviceupdate Check Status: OK
thread_serviceupdate Optimize Note: Table does not support optimize, doing recreate + analyze instead
thread_serviceupdate Optimize Status: OK
threadrate Check Status: OK
threadrate Optimize Status: OK
threadread Check Status: OK
threadread Optimize Status: OK
threadredirect Check Status: OK
threadredirect Optimize Status: OK
threadviews Check Status: OK
threadviews Optimize Status: OK

VB ACP -> Forums & Moderators -> Forum Blocks Manager -> Reload Block Types


VB ACP -> Settings -> Options -> Turn Your vBulletin On and Off -> Turn site on
Reply With Quote
  #11  
Old 08 Feb 2015, 02:42
edgeless edgeless is offline
 
Join Date: Mar 2013
This may seem like a strange question... but have you recently attempted to change to UTF-8 encoding from ISO-8859 ?
Reply With Quote
  #12  
Old 08 Feb 2015, 08:50
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Originally Posted by edgeless View Post
This may seem like a strange question... but have you recently attempted to change to UTF-8 encoding from ISO-8859 ?
Nope, I haven't touched anything like that. Cant speak for what the official VB patches will have done.

For the sake of completeness, over on vb.com it was suggested that the following should be added to the config.php


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I already had that line in my config.php. My changelog shows this as being there for over a year now (it was added to prevent some PHP error displaying after an upgrade)
Reply With Quote
  #13  
Old 08 Feb 2015, 09:55
edgeless edgeless is offline
 
Join Date: Mar 2013
Originally Posted by MrEyes View Post
Nope, I haven't touched anything like that. Cant speak for what the official VB patches will have done.
Hmm, okay. Sadly, I'm at a loss. So no idea at all what may have led to your search functionality problem? Did anything that might be significant happen before you noticed it failing? Have you considered restoring the database to a point from before you noticed the search function was broken?

Originally Posted by MrEyes View Post
For the sake of completeness, over on vb.com it was suggested that the following should be added to the config.php


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I already had that line in my config.php. My changelog shows this as being there for over a year now (it was added to prevent some PHP error displaying after an upgrade)
Yeah, I've seen that before. They tend to gravitate toward not addressing actual causes for errors, but rather hiding them. And another favorite fix of theirs seems to be telling people to re-upload all of their source files to the hosting server. I suppose that can fix things sometimes... but still
Reply With Quote
  #14  
Old 08 Feb 2015, 15:40
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Originally Posted by edgeless View Post
.....telling people to re-upload all of their source files to the hosting server....
For the sake of completeness and as a preemptive measure I have just done that (everything but the images and install folders)

Last edited by MrEyes; 08 Feb 2015 at 15:50.
Reply With Quote
  #15  
Old 08 Feb 2015, 19:35
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Stupid question but.... is your Search Type set to DB Search or Sphinx Search?

If it's set to DB Search, how many rows in your searchcore and searchcore_text tables?

Are there any errors in your error_logs (if you don't know where they are, ask your host) when you try to search?

Has anything changed on your server lately?
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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


New To Site? Need Help?

All times are GMT. The time now is 08:16.

Layout Options | Width: Wide Color: