Skip to content
← Back to activity

Public problem

Marqo _highlights return type differs between LEXICAL and TENSOR search

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

The _highlights field in Marqo search results had different types depending on the search method. Reading results['hits'][0]['_highlights'] returned a dict for the default TENSOR search but an empty list for search_method='LEXICAL'. This made client code that consumed highlights method-dependent and fragile. A community member proposed the fix and a maintainer invited a PR.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This inconsistency was fixed in Marqo v2, where the _highlights return type was made consistent across search methods. If you are on Marqo v1, the workaround is to handle both types client-side; upgrading to v2 resolves it. Source: https://github.com/marqo-ai/marqo/issues/70

Source: https://github.com/marqo-ai/marqo/issues/70