If you’re OK with showing the results on a page refresh, you’re good. If you want to keep the AJAX on, you may be able to fix that by changing how the lightbox is attaching it’s handler to the images. You’ll need to have some JS skills for this.
If the lightbox doesn’t work after showing a search result while using AJAX, then that means the lightbox handler is attached by statically targeting an element on the page. Using jQuery, you can change how it attaches the handler so that when the search results come in, the handlers will be dynamically attached to the new content. This is done by targeting the wrapper (a div with a class of “pdb-list”) of the search results, then targeting the individual images as a selector…for example:
$('pdb-list').on( 'click', '.pdb-image img', lightbox_handler );
Where “lightbox_handler” is whatever method the lightbox plugin uses to attach its handler.
This works because the $(‘.pdb-list’) element is not changed by the AJAX, only its content, so the attachment is not broken when the AJAX results come in.