1 (edited by 111111 2016-08-04 09:53)

Topic: search bug and how to correction.

punbb version : 1.44 - 1.3
post message is : 123abc
serarch : 123 
result: can't find the post ,search did't work.

serarch : abc
result: can't find the post ,search did't work.

serarch : 123abc
result: can find the post ,search work coreectly.

-----------------------------------------------------------------------------------

reason:
search sql statement ,like lack % .

-----------------------------------------------------------------------------------

correction:
file name: punbase/include/search_functions.php
position:  105

replace :  'WHERE'       => 'w.word LIKE \''.$forum_db->escape(str_replace('*', '%', $cur_word)).'\''

with         : 'WHERE'         => 'w.word LIKE \'%'.$forum_db->escape(str_replace('*', '', $cur_word)).'%\''


can you read it ? my english is poor.

By the way , this account is't mine .
I have mail like xxx@163.com , xxx@mail2world.com ,but I can't rgister a forum account .
How difficult to register it is !

if this is your account ,please email to 191682430@163.com .

Re: search bug and how to correction.

Search engine work a little differently. Words form posts are extracted and saved into table "search_words" and "search_matches". Punbb does't perform full-text search within all posts ever submitted (that would kill the server), instead it looks throgh indexed tables mentioned above.

I am afraid it will be hard to achieve your goal.

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

Re: search bug and how to correction.

You are right .
If search in many rows ,server will be killed.
Once I want to search in posts , I agree that it's better search in search_words .
But it's better that add % in like statement,it will not increase load of server , and makes it easier to search..

Re: search bug and how to correction.

seems legit.. big_smile

sorry my BAD english T___T
Have a nice day >.<
(^____^)v