Open Dhravya opened 2 years ago
Can you share your Schema here as well? I'm assuming that domain
is a string
given the error but would like to be sure. Thanks!
Also, 99.9% certain this is a bug. Just need to add code to check when building the query for the special case of an empty string.
yep
This may not be immediately doable: https://forum.redis.com/t/how-to-query-for-absence-empty-field/147
it might be a case of storing a special value to signify "not set", such as an underscore (something that wouldn't normally be matched on) so it can then be searched on.
What would we want to expected behavior to be here? Are you wanting to search where domain is an empty string, or do you just not want to include domain in the search if it is empty. I could certainly implement the latter, but, as @CaptainCodeman mentions, the former isn't terribly doable.
You could work around this as well, if you want the latter scenario, like this:
const search = repository.search();
search.where("slug").eq(slug);
if (domain) search.and("domain").eq(domain);
const image = search.return.first();
it happens to me something very similar but when I search strings containing "@" I get this error: Syntax error at offset 27 near com ie: Page @email:(kikomen@gmail.com)
Similar issue when searching for strings containing "-
"
I have a search query that looks something like this:
However, upon running this, I receive the following error:
Most likely, the redis command generated is invalid because there's no value over there.
This is far from ideal, because in some cases, I would want to fallback to an empty string in the search query.