Jump to content

searchResultsSnippets template wants index_id which is not present with Elasticsearch


Go to solution Solved by Marc Stridgen,

Recommended Posts

data-ipsLightbox-group='g{$indexData['index_id']}'

Elasticsearch never returns that in the $indexItem array.

IN_DEV this will Whoops with missing array element when using Streams or Search.

Live it functions but image groupings are broken. Quoting @Martin A. "meat mixed with stats" (lamb chops with hard drive metrics to be precise)

The images will display correctly in the snippet, but when you lightbox them out and navigate through them, with a data-lightboxgroup="g" value instead of "g12345" its grabbing all the images on the page and you can navigate through them all.

Apparently, (@Martin A. looked here as we troubleshot this just now), MySQL is clear here and returns the index_id in the array.

If anyone here is having problems and selfhosts (and is using Elastic) you can patch this by changing the template bit there from index_id to index_object_id (or index_item_index_id perhaps) which is present in the $indexItem array returned via Elastic.

This can either be patched in the code to return the correct bit in the array if Elastic is present, or one can hack at the template like we did. There's also the smallest of possibilities of a collision between different apps returning the same item_ids but that's something for IPS to hash out if/when this gets patched.

Locally this is Elastic 7.2.0 if this matters.

Link to comment
Share on other sites

  • 2 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...