Attempts to fix full text search fields

Adds field name alias to fix full text searches.

Closes #42
This commit is contained in:
Simon Prickett 2021-12-09 23:11:15 +00:00 committed by GitHub
parent 66fdb8a046
commit 800ec69565
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1429,7 +1429,7 @@ class HashModel(RedisModel, abc.ABC):
if getattr(field_info, "full_text_search", False) is True:
schema = (
f"{name} TAG SEPARATOR {SINGLE_VALUE_TAG_FIELD_SEPARATOR} "
f"{name}_fts TEXT"
f"{name} AS {name}_fts TEXT"
)
else:
schema = f"{name} TAG SEPARATOR {SINGLE_VALUE_TAG_FIELD_SEPARATOR}"