Support Forum

Search Invalid database query

61 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

… just a little more testing here…

EK Edward Koon
Edward Koon
Member

Possibly using Google custom search might be a better option? I’m using it on my sites, and it’s possible to limit the results returned to forum posts only in the setup.

Just my two cents worth.. cool

YS Yellow Swordfish
Yellow Swordfish
Member

Does that mean that Google has a copy of every post ever made? Actually it can not have that as even google bot dies when confronted with a private forum…

EK Edward Koon
Edward Koon
Member

Yellow Swordfish said
Does that mean that Google has a copy of every post ever made? Actually it can not have that as even google bot dies when confronted with a private forum…

You Betcha.. If your posts are public, and especially if your site mapped.

Google and the NSA has every post ever written. And if you delete a post they still have a cache of it.

MP Mr Papa
Mr Papa
Member

the diff between you and Andy was public vs private…

KV kvr28
kvr28
Member

Yellow Swordfish said
… just a little more testing here…

no worries, just let me know

YS Yellow Swordfish
Yellow Swordfish
Member

Well as you are feeling brave let’s go for it! smile

The attached file is called sp-search-view-class.php and it needs to be located at:

/simple-press/forum/content/classes/

You will see the current file at that location. I would recommend that you do not overwrite this but rename it so that you can juggle them back quickly and easily if you encounter any problems.

Please do remember that this is very much beta/in-progress work. Good news is it can do no damage as it only queries of course. The only real concern is if it is (a) returning data at all when searching and (b) the correct data! It should be as the queries are fairly straightforward. It is more the permutation of options that needs further testing.

And this code should work with either the MyISAM or InnoDB storage engine. It males no use of the FULLTEXT index. Note that there are three tables overall that have a FULLTEXT index. These are sfposts, sftopics and sftags which you will only have if you have the Simple:Press Tags plugin activated.

So please do go ahead and let us know how it goes. It was always the plan that our targeted 5.5.0 release would investigate and support the InnoDB storage engine so you will be the first to try it out! Thanks for that.

Note the file does need unzipping. An obvious point but not everyone realises that as we have found in the past!

KV kvr28
kvr28
Member

just tested it on my staging server and it works perfect, thank-you yellow!

YS Yellow Swordfish
Yellow Swordfish
Member

The main thing is to make sure it works with all the different permutations under the Advanced Search options. I.e., phrase, all words, with and without topic titles etc.

It seems to be holding up fine with my own testing but there is nothing like handing code to a user to break smile

MP Mr Papa
Mr Papa
Member

appreciate it!  just numerous amount of permutations based on configurations..

KV kvr28
kvr28
Member

I made it go live this morning and I checked all the different settings through advanced and do not see any issues with it, thanks again

YS Yellow Swordfish
Yellow Swordfish
Member

Thanks for the update., I hope to get it live on our site as well over the next few days.

KV kvr28
kvr28
Member

Yellow, is this something that will over written when sp updates? Will I have to manually upload the file with each update? Also, one of my forum members posed this question to me on the search function

Yay on the search working. Does the forum give options on how the search results are presented? Namely, can it show a snippet of relevant text with highlighted search terms and then take you to the relevant thread page/post? 

would adding topic tags plug in help with this at all?

YS Yellow Swordfish
Yellow Swordfish
Member

On the first question we expect that this version will become the regular version of the file.

It is perhaps worth mentioning the pros and cons of innoDB tables over the more regular myISAM tables. It is true that they are generally more efficient. This is only really going to have any noticeable effect on a very busy site where there are lots of users in contention for database queries. In those circumstances there is no doubt that InnoDB are best. The downside is that without Fulltext index support, searches will be slower. Again – not really noticeably but certainly measurably.

But that does suggest that search takes a small hit for the good of the rest and when you put it that way it is probably a good thing. So – our next development cycle always had InnoDB support as a main feature point. This means that the search code you have will remain in core unless something drastic turns up in testing. I have also, over the last couple of days, written a plugin that gives a UI to any users wishing to upgrade their forum tables to InnoDB and removed any preference for MyISAM tables that existed up to 5.4.2.

On to the second question. This is actually much harder than it sounds. We started to do this once and had to pull back because getting it right is difficult, prone to error and does, believe it or not, have quite a major impact in performance. So currently I am afraid there are no immediate plans to resurrect this but it remains on the future development list as something we do want to conquer at some point.