News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Searching without search text

Started by redpotato, January 17, 2011, 01:17:01 PM

Previous topic - Next topic

redpotato

Hello,

I am trying to search by no search text which mean if I search by no search word, it should give me all.
I have modified file Search.php.
It actually has some other criteria that I have inserted.

if (!isset($search_params['search']) || $search_params['search'] == ''){
   //$context['search_errors']['invalid_search_string'] = true;
so it does not give me the error message but I don't think it does not give me correct information.

is there any part I need to modify?? to have correct search result information with no search word.

please give me some tips!

thanks!

Arantor

It's really not recommended to do it that way, since at least one of the backends will break if you try that. (There are multiple, pluggable search backends, including MySQL FULLTEXT - which will break, a custom index - which will break, and the Sphinx plugin - which will work fine)

Even if it didn't break, forcing it through the search isn't the fastest way to get posts - if you want all posts, you'd be better starting with index.php?action=recent and expanding that, to be honest.

Advertisement: