SimpleSearch
SimpleSearch copied to clipboard
make search results available in posthooks
I think it would be helpful to have a search result array to be used in posthooks.
with little effort i've achieved it.
before: $search->postHooks->loadMultiple($postHooks,$response['results'],array( 'hooks' => $postHooks, 'search' => $searchString, 'offset' => !empty($_GET[$offsetIndex]) ? intval($_GET[$offsetIndex]) : 0, 'limit' => $limit, 'perPage' => $limit, ));
after: $search->postHooks->loadMultiple($postHooks,$response['results'],array( 'hooks' => $postHooks, 'search' => $searchString, 'offset' => !empty($_GET[$offsetIndex]) ? intval($_GET[$offsetIndex]) : 0, 'limit' => $limit, 'perPage' => $limit, 'response' => $response['results'], ));
so in posthook snippet the search result is available in the $response variable.
HTH