[support] How to increase number of results for the drupal search

Ivan Sergio Borgonovo mail at webthatworks.it
Mon Dec 28 17:17:47 UTC 2009


On Mon, 28 Dec 2009 16:45:34 +0100
Michel Morelli <michel at ziobuddalabs.it> wrote:

> Hi all. I have a site and a client that want to increase the
> number of items that search function returns: from 10 to 20.
> 
> How can I do it ?

It looks as it is hardcoded in do_search()

$result = pager_query("$select $sort_parameters", 10, 0,
$count_select, $arguments);

You could write a hook_search cloning node_search and tweak where
needed.

You're going to spend more time patching your cloned version of
node_search every time there is a new node.module rather than
hacking core... unless you plan to actually maintain your own search
routines and not just copy and paste node_search.

Maybe there is somewhere an issue about configuring # of returned
results... patch core adding an interface to that setting and maybe
you'll see it accepted... I'd be curious how long does it take to
get an idea about how much it's worth to pursue this path in certain
circumstances...


-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



More information about the support mailing list