The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!perl

use Test::More;
use strict;
use warnings;
our $es;
my $r;

# HIGHLIGHT
$r = $es->search(
    query     => { term   => { text => 'foo' } },
    highlight => { fields => { text => {} } }
);

like $r->{hits}{hits}[0]{highlight}{text}[0],
    qr{<em>foo</em>},
    'Highlighting';

1