Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexander-schranz opened this issue Feb 4, 2024 · 3 comments
Open
Assignees

Comments

@alexander-schranz
Copy link

alexander-schranz commented Feb 4, 2024

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.

@oshadmi
Copy link
Collaborator

oshadmi commented Feb 4, 2024

@alexander-schranz HIGHLIGHT is currently not supported with JSON (see limitations)

(I was able to get some highlight by adding a RETURN 1 title before the HIGHLIGHT argument and without dialect 3)

@alexander-schranz
Copy link
Author

@oshadmi Really thank you for the quick response here!

Is this something which is broken for the DIALECT 3 and 4. For DIALECT 1 and 2 it seems to work. But I require DIALECT 3 because of some other issue / bugs in the filtering which only works in later DIALECTS.

Is there something on the roadmap for Highlighting with the JSON field?

Copy link

github-actions bot commented Apr 5, 2024

This issue is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the stale label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants