The search page simply searches on the items, item sets, and site page resources separately and returns those results together. Without specifying a specific site ID to filter by, searches on those resources will always return items across all sites by default.
I suppose my question really is, Does a full-cross-site-search rest api endpoint already exist as part of Omeka? And if so, What does it look like? I can’t find examples.
My comment was meant to say, the search form you referred to does multiple requests because that’s the only way to do it. There is no single endpoint for searching of “everything,” though most resource searches are inherently “cross-site” through the API unless otherwise specified (except of course the ones dealing with sites specifically).
Well I thought it worked fine until I tried it without logging into the application.
Omeka\Mvc\Exception\PermissionDeniedException: Permission denied for the current user to access the index action of the MyModule\Controller\MyModuleController
I’ve been reading Laminas docs all day and am confused.
Hi @buttle, I think what you might need to specify that login isn’t required using something similar to the code snippet below in the onBootstrap method of your Module.php file:
/**
* Code to run when first using the module.
*
* @param MvcEvent $event
*/
public function onBootstrap(MvcEvent $event): void
{
parent::onBootstrap($event);
$acl = $this->getServiceLocator()->get('Omeka\Acl');
$acl->allow(null, ['MyModule\Controller\MyModuleController']);
}
The two lines I shared work for me. I’m not sure why you would need to include the addResource method.
I think the one thing you’ll want to check is that you change ‘MyModule\Controller\MyModuleController’ to match what you have in your module.config.php for that module. It should be the key of the array and not necessarily the Controller class, which could be different. I was just trying to make my best guess from what you had shared.