Inquiry about HIGHLIGHT()

Hello!

Im trying to replicate the search functionality of manticore documentation, such that as i write i can see the matching results highlighted like so:

So far I have been able to implement the HIGHLIGHT function with partial success.

I created my table like this:

CREATE TABLE ITEMS(
    id bigint,
    itemid text,
    displayname text,
    brand text,
    lastmodifieddate timestamp
)
min_prefix_len = '1'
min_infix_len = '2'
ngram_len = '1'
charset_table = 'non_cjk, 0..9'
ngram_chars = 'cont';

the following is my query and the result i get

mysql> SELECT HIGHLIGHT({},'displayname' ,'contain*') FROM items WHERE MATCH('contain*');
+-------------------------------------------+
| highlight({},'displayname' ,'contain*')   |
+-------------------------------------------+
| SK AISLE <b>CONTAINMENT</b>, DOOR, 1200MM |
| HOPPER <b>CONTAINER</b> - 7L              |
| CHAIN <b>CONTAINER</b>                    |
| HOPPER <b>CONTAINER</b> - 14L             |
| HOPPER <b>CONTAINER</b> - 3L              |
+-------------------------------------------+

At the moment this works for me but it would be great if i can get the following output:

mysql> SELECT HIGHLIGHT({},'displayname' ,'contain*') FROM items WHERE MATCH('contain*');
+-------------------------------------------+
| highlight({},'displayname' ,'contain*')   |
+-------------------------------------------+
| SK AISLE <b>CONTAIN</b>MENT, DOOR, 1200MM |
| HOPPER <b>CONTAIN</b>ER - 7L              |
| CHAIN <b>CONTAIN</b>ER                    |
| HOPPER <b>CONTAIN</b>ER - 14L             |
| HOPPER <b>CONTAIN</b>ER - 3L              |
+-------------------------------------------+

I have read several times the documentation but so far I have been unable to figure out the solution.

that is not built in functionality. You have to implement it in your client as it was done in our documentation
https://github.com/manticoresoftware/doc/blob/master/App/Web/src/Infrastructure/Persistence/Search/ManticoreSearchRepo.php the highlightQueryWords

Thanks for the reply. I tried looking into the repo but i got a 404 error.

Given that it is not implemented within manticore my guess is that you are using a regular MATCH() and you are performing the highlight on the server side just before sending the information to the client side.