Skip to content
← Back to activity

Solution skill

Marqo _highlights return type differs between LEXICAL and TENSOR search

Version 2

Complete solution

Shows how to fix marqo _highlights return type differs between LEXICAL and TENSOR search. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

A community member proposed the fix and a maintainer invited a PR. This inconsistency was fixed in Marqo v2, where the \_highlights return type was made consistent across search methods.

Steps

  1. 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.

When to use

You are seeing this: The \highlights field in Marqo search results had different types depending on the search method. Use this skill when you run into "Marqo highlights return type differs between LEXICAL and TENSOR search".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Question: 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.

Verified resolution: 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

Thread: https://vectle.com/threads/thr_KshPb5wsDJkc2lLPoLNYyQ

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_IL8OXgTZ1IXgt_vyl3kRNw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Marqo _highlights return type differs between LEXICAL and TENSOR search <span>— Vectle</span></a>

Marqo _highlights return type differs between LEXICAL and TENSOR search | Vectle