Add search button to Universal Viewer?

Hi all, bothering you again with, I hope, one last question. I’d like to add a button to search text within my PDF documents, but after a few days looking around the web and trying to figure this out on my own (and with the help of our Lab fellows) I am still unable to do so.

In short: this is what I have https://eastbaypunkda.com/s/east-bay-punk-digital-archive/item/622#?c=&m=&s=&cv=

And this is what I’d like to have https://neptun.unamur.be/s/neptun/item/1167#?c=0&m=0&s=0&cv=0

I’ve looked at a number of Omeka sites and it seems like many of them have different configurations, but I can’t seem to figure out where I need to be making these changes. I was able to hide the footer by editing the config.json file that I uploaded in my theme’s assets’ folder, but I can’t seem to be able to do anything else from there. What I really need is the search button, but it wouldn’t hurt to figure out how to make other changes as well. I tried to look for documentation and reverse-engineer those other websites but have been unable to find anything helpful – their config file seems similar to mine. The only thing I can think of, is that the IIIF server plugin somehow processes the file differently? Any heads up? This is the last thing holding me up before I can finally launch the site (I decided to wait to deal with theming for now).

Bonus question: What do the Force base of url (from) and (to) settings in the IIIF Server Module do, exactly?

Many thanks, again.

  • Stefano

To use search inside Universal Viewer, see the module IiifSearch.
The force from/to allows to manage complex configuration, where the server is behind a proxy or a network tool. It allows to have only https url only too, that are required in many cases (mix https with http doesn’t work in all cases).

Hi Daniel! Many thanks for your suggestion and your clarification.

I tried to follow the installation instructions for IiifSearch, but I was unable to get it to work. The instructions seem to require that I add the following url: http://yourdomain/omeka-s/iiif-search/ to the “IIIF Search Url” field in the IIIF Server’s settings, however, I can’t find such thing in my settings. Any heads up?

1 Like

(I must also add that all my PDF are already OCR’d and contain text, not sure if that makes any difference, but thought I’d say it just in case)

1 Like

Yes, this module requires another module, ExtractOcr, so it allows to copy the text of your ocrized pdf inside a property, so it is available for search by Omeka and the iiif server.

Ok, good to know. I was able to install both. Just trying to figure out where that “IIIF Search URL” it’s supposed to go now, since it’s nowhere to be found. Maybe it’s not compatible with the latest version of the IIIF Server plugin?

I tried to open a ticket on the IIIF Search GitHub page https://github.com/bubdxm/Omeka-S-module-IiifSearch/issues/2

All I’m really trying to do at this time is to have searchable PDFs on my site. I don’t NEED to use the Universal Viewer. Would I be able to achieve that by using your PDFViewer module instead? Would I be able to get something like this?

If so, I can ask the server admins if they can install pdf.js and use that until I can figure out the UniversalViewer conundrum.

The search is not a feature I use currently, so I can’t answer you more. Wait for an answer on github.
The Pdf Viewer module is an integration of the mozilla pdf.js inside a module. Else, you can use the default module too (PdfEmbed).

I can’t find the module IiifSearch on Github any more. The user bubdxm is not registered there any longer?! Where/How can I get this module?

Would be great to have a solution to integrate full text within the UniversialViewer.

Yes, the bubdxm account (library of the Université de Bordeaux) was just removed. I’m contacting the admin to get some modules I don’t have.

Daniel is right, I have been doing some cleaning on our (bubdxm) github account as part of our move from omeka classic to omeka-s. I will republish all what is needed in the next few weeks, sorry for the inconvenience.

3 Likes

Thank you for the fast response! Would be great to have this feature back for omeka-s and UniversialViewser soon.

Hi,

I’m trying to add the search capability to universal viewer. I’d like to use the iiifSearch module and extractOCR module (I work with searchable pdf). Do you know when this module will become available ?

Thanks a lot for all this work on omeka-s :smiley:

Fred

Hi symac! I’m really interested in testing your module Iiif-search ¿When will it be available? Thank you so much!

1 Like

It’s been a long time but I have put back online the two modules on github :

I am still figuring out if everything works fine with the latest version of omeka-S but it should be usable.

1 Like

Thanks for your update!

Thank you! I will test asap.

Hi Sylvain, thank you so much for your work on this. I just tried to run ExtractOCR on two different Installations (one runs Omeka S 1.4, the other one Omeka S 1.3) and in both cases when I ran the process, I received an error, all my PDFs were deleted from the server, and no XML was generated. Below is the error log, any thought on what could’ve gone wrong?

2019-11-08T15:05:15+00:00 INFO (6): Extracting OCR from 49
2019-11-08T15:05:16+00:00 ERR (3): Error downloading http://ebdaprova.lungblock.nyc/files/original/b00dddac84b7d8496e64d0186c444ebac9bfe19c.xml: 404 Not Found
2019-11-08T15:05:16+00:00 ERR (3): exception ‘Omeka\Api\Exception\ValidationException’ in /home3/smorello/ebdaprova.lungblock.nyc/application/src/Api/Adapter/AbstractEntityAdapter.php:550
Errors:
{
“download”: [
“Error downloading http://ebdaprova.lungblock.nyc/files/original/b00dddac84b7d8496e64d0186c444ebac9bfe19c.xml: 404 Not Found”
]
}
Stack trace:
#0 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Api/Adapter/AbstractEntityAdapter.php(261): Omeka\Api\Adapter\AbstractEntityAdapter->hydrateEntity(Object(Omeka\Api\Request), Object(Omeka\Entity\Media), Object(Omeka\Stdlib\ErrorStore))
#1 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Api/Manager.php(224): Omeka\Api\Adapter\AbstractEntityAdapter->create(Object(Omeka\Api\Request))
#2 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#3 /home3/smorello/ebdaprova.lungblock.nyc/modules/ExtractOcr/src/Job/ExtractOcr.php(49): Omeka\Api\Manager->create(‘media’, Array)
#4 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Job/DispatchStrategy/Synchronous.php(34): ExtractOcr\Job\ExtractOcr->perform()
#5 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Job/Dispatcher.php(105): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#6 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Job/Dispatcher.php(91): Omeka\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#7 /home3/smorello/ebdaprova.lungblock.nyc/modules/ExtractOcr/Module.php(251): Omeka\Job\Dispatcher->dispatch(‘ExtractOcr\Job\…’, Array)
#8 /home3/smorello/ebdaprova.lungblock.nyc/modules/ExtractOcr/Module.php(160): ExtractOcr\Module->startExtractOcrJob(49, ‘Lookout405.xml’, ‘b00dddac84b7d84…’, ‘pdf’, ‘/home3/smorello…’, ‘http://ebdaprov…’)
#9 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Controller/Admin/ModuleController.php(272): ExtractOcr\Module->handleConfigForm(Object(Omeka\Controller\Admin\ModuleController))
#10 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\Admin\ModuleController->configureAction()
#11 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#12 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#14 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#15 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#18 /home3/smorello/ebdaprova.lungblock.nyc/index.php(21): Zend\Mvc\Application->run()
#19 {main}

Hi @veritas44
I’m sorry if it didn’t work for you, and I don’t understand how PDF were deleted from the server because of the module, as it is just trying to add media (OCR XML file) and there is no call to the API do delete anything.

Anyway, I have just tried a fresh install of omeka-S 1.4.0 to try to replicate your issue and everything works fine for me. The version of the module you are using has evolved in a new version that has been release recently, v. 1.1 which has been tested more extensively (even if still quite new) but is now set to be compatible with 2.* branch of omeka-s.

If you can update your site easily to this version, don’t hesitate to give a try to 1.1 which might works better.

I am afraid I don’t have more idea about the origin of the issue in your specific case, sorry.

S.

Thank you for your prompt reply. The first time I did it on my actual website (eastbaypunkda.com), but now I’m using an installation I only use for tests (the one from which I reported the previous log). I updated the latter to Omeka 2.0.2 installed the 1.1. version of the extractor, but the same thing happened on the only PDF I uploaded for the purpose of testing. The output message I received was that the XML file was created, but now there is neither an XML nor the original PDF attached to the item (and the files have also disappeared from the /files folder on the server).

I don’t expect you to fix this for me, just thought you’d be interested in knowing! Below is the log, which I think looks a lot like the previous one.

2019-11-10T03:20:38+00:00 INFO (6): Extracting OCR from 99
2019-11-10T03:20:39+00:00 ERR (3): Error downloading http://ebdaprova.lungblock.nyc/files/original/d1ff111dc5a23ebee3d1e122c74867a09ecee94f.xml: 404 Not Found
2019-11-10T03:20:39+00:00 ERR (3): exception ‘Omeka\Api\Exception\ValidationException’ in /home3/smorello/ebdaprova.lungblock.nyc/application/src/Api/Adapter/AbstractEntityAdapter.php:567
Errors:
{
“download”: [
“Error downloading http://ebdaprova.lungblock.nyc/files/original/d1ff111dc5a23ebee3d1e122c74867a09ecee94f.xml: 404 Not Found”
]
}
Stack trace:
#0 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Api/Adapter/AbstractEntityAdapter.php(276): Omeka\Api\Adapter\AbstractEntityAdapter->hydrateEntity(Object(Omeka\Api\Request), Object(Omeka\Entity\Media), Object(Omeka\Stdlib\ErrorStore))
#1 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Api/Manager.php(224): Omeka\Api\Adapter\AbstractEntityAdapter->create(Object(Omeka\Api\Request))
#2 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#3 /home3/smorello/ebdaprova.lungblock.nyc/modules/ExtractOcr/src/Job/ExtractOcr.php(49): Omeka\Api\Manager->create(‘media’, Array)
#4 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Job/DispatchStrategy/Synchronous.php(34): ExtractOcr\Job\ExtractOcr->perform()
#5 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Job/Dispatcher.php(105): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#6 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Job/Dispatcher.php(91): Omeka\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#7 /home3/smorello/ebdaprova.lungblock.nyc/modules/ExtractOcr/Module.php(250): Omeka\Job\Dispatcher->dispatch(‘ExtractOcr\Job\…’, Array)
#8 /home3/smorello/ebdaprova.lungblock.nyc/modules/ExtractOcr/Module.php(159): ExtractOcr\Module->startExtractOcrJob(99, ‘Lookout405wm.xm…’, ‘d1ff111dc5a23eb…’, ‘pdf’, ‘/home3/smorello…’, ‘http://ebdaprov…’)
#9 /home3/smorello/ebdaprova.lungblock.nyc/application/src/Controller/Admin/ModuleController.php(272): ExtractOcr\Module->handleConfigForm(Object(Omeka\Controller\Admin\ModuleController))
#10 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\Admin\ModuleController->configureAction()
#11 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#12 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#14 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#15 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /home3/smorello/ebdaprova.lungblock.nyc/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#18 /home3/smorello/ebdaprova.lungblock.nyc/index.php(21): Zend\Mvc\Application->run()
#19 {main}