Skip to content

[Help] Highlighting unexpected error No such property title #4420

@alexander-schranz

Description

@alexander-schranz

This is not a bug or feature request. I maybe just doing something wrong.

I'm currently try to implement Highlighting into the RediSearch Adapter for SEAL the Search Engine Abstraction Layer for PHP, but run into a error I'm not aware of what I did miss in the documentation:

RedisException: No such property `title`

I tried to follow: https://redis.io/docs/interact/search-and-query/advanced-concepts/highlight/#highlighting

Here a complete log via Profiler from Redis Insight:

"FT.INFO" "test_complex"
"FT.CREATE" "test_complex" "ON" "JSON" "PREFIX" "1" "test_complex" "SCHEMA" "$['uuid']" "AS" "uuid" "TAG" "SORTABLE" "$['title']" "AS" "title" "TEXT" "$['article']" "AS" "article" "TEXT" "$['blocks']['text'][*]['title']" "AS" "blocks__text__title" "TEXT" "$['blocks']['text'][*]['description']" "AS" "blocks__text__description" "TEXT" "$['blocks']['embed'][*]['title']" "AS" "blocks__embed__title" "TEXT" "$['footer']['title']" "AS" "footer__title" "TEXT" "$['created.raw']" "AS" "created__raw" "TAG" "SORTABLE" "$['commentsCount']" "AS" "commentsCount" "NUMERIC" "SORTABLE" "$['rating']" "AS" "rating" "NUMERIC" "SORTABLE" "$['isSpecial']" "AS" "isSpecial" "TAG" "$['comments'][*]['text']" "AS" "comments__text" "TEXT" "$['tags'][*]" "AS" "tags" "TEXT" "$['tags.raw'][*]" "AS" "tags__raw" "TAG" "$['categoryIds'][*]" "AS" "categoryIds" "NUMERIC"
"FT.INFO" "test_simple"
"FT.CREATE" "test_simple" "ON" "JSON" "PREFIX" "1" "test_simple" "SCHEMA" "$['id']" "AS" "id" "TAG" "SORTABLE" "$['title']" "AS" "title" "TEXT"
"JSON.SET" "test_complex:23b30f01-d8fd-4dca-b36a-4710e360a965" "$" '{"uuid":"23b30f01-d8fd-4dca-b36a-4710e360a965","title":"New Blog","header":{"image":{"media":1}},"article":"<article><h2>New Subtitle<\\/h2><p>A html field with some content<\\/p><\\/article>","blocks":{"text":[{"_originalIndex":0,"title":"Titel","description":"<p>Description<\\/p>","media":[3,4]},{"_originalIndex":1,"title":"Titel 2"},{"_originalIndex":3,"title":"Titel 4","description":"<p>Description 4<\\/p>","media":[3,4]}],"embed":[{"_originalIndex":2,"title":"Video","media":"https:\\/\\/www.youtube.com\\/watch?v=iYM2zFP3Zn0"}]},"footer":{"title":"New Footer"},"created":"2022-01-24T12:00:00+01:00","commentsCount":2,"rating":3.5,"isSpecial":true,"comments":[{"email":"admin.nonesearchablefield@localhost","text":"Awesome blog!"},{"email":"example.nonesearchablefield@localhost","text":"Like this blog!"}],"tags":["Tech","UI"],"tags.raw":["Tech","UI"],"categoryIds":[1,2]}'
"JSON.SET" "test_complex:79848403-c1a1-4420-bcc2-06ed537e0d4d" "$" '{"uuid":"79848403-c1a1-4420-bcc2-06ed537e0d4d","title":"Other Blog","header":{"video":{"media":"https:\\/\\/www.youtube.com\\/watch?v=iYM2zFP3Zn0"}},"article":"<article><h2>Other Subtitle<\\/h2><p>A html field with some content<\\/p><\\/article>","footer":{"title":"Other Footer"},"created":"2022-12-26T12:00:00+01:00","commentsCount":0,"rating":2.5,"isSpecial":false,"comments":[],"tags":["UI","UX"],"tags.raw":["UI","UX"],"categoryIds":[2,3]}'
"JSON.SET" "test_complex:8d90e7d9-2b56-4980-90ce-f91d020cee53" "$" '{"uuid":"8d90e7d9-2b56-4980-90ce-f91d020cee53","title":"Other Thing","article":"<article><h2>Other Thing<\\/h2><p>A html field with some content<\\/p><\\/article>","footer":{"title":"Other Footer"},"created":"2023-02-03T12:00:00+01:00","commentsCount":0,"comments":[],"tags":["Tech","UX"],"tags.raw":["Tech","UX"],"categoryIds":[3,4]}'
"JSON.SET" "test_complex:97cd3e94-c17f-4c11-a22b-d9da2e5318cd" "$" '{"uuid":"97cd3e94-c17f-4c11-a22b-d9da2e5318cd"}'
"FT.SEARCH" "test_complex" "%%Blog%%" "HIGHLIGHT" "FIELDS" "1" "title" "TAGS" "<mark>" "</mark>" "DIALECT" "3"
# error appears
"FT.DROPINDEX" "test_complex"
"FT.DROPINDEX" "test_simple"

The used docker image is redis/redis-stack:7.2.0-v6 and redis/redis-stack:7.2.0-v8.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions