Hi Cromers -
Firing a 'blank' or 'null' query is intended to 'show all results'.
Simply showing all results has its own issues, though:
- How will they be sorted? Date? Title? Size?
- How will the query summary message be displayed? "You searched for XXX."?
- What should be logged by the search analytics system?
Once you've attempted to answer those questions for yourself, enabling support for null queries is reasonably straightforward.
If you're using the deprecated Classic UI, you can add the following to collection.cfg:
ui.null_query_enabled=true
If you're using the Modern UI, two hook scripts will be required:
hook_pre_process.groovy:
// Fix to enable ui.null_query_enabled functionality
if (transaction.question.query == null) {
// query must be set to something or padre isn't called _ is stripped out by padre when processing the query
transaction.question.query = "_"
transaction.question.originalQuery = "_"
// set the system query value to run a null query
transaction.question.additionalParameters["s"] = ["!padrenull"]
}
hook_post_process.groovy:
// Allow the modern UI to handle an undefined queryCleaned value (will occur for the above code as s params aren't included in queryClean)
if ( transaction.response != null && transaction.response.resultPacket.queryCleaned == null)
{
transaction.response.resultPacket.queryCleaned ="";
}
See also: http://docs.funnelback.com/user_interface_hook_scripts.html