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

[Core] Add Support for IsNullCondition or IsEmptyCondition #318

Open
alexander-schranz opened this issue Dec 13, 2023 · 1 comment
Open
Labels
features New feature or request SEAL Core Seal Core related issue

Comments

@alexander-schranz
Copy link
Member

I did not yet think about this one in deep yet not in all search engines something like null does exists, example some even don't allow to send null and require to send nothing instead.

I'm not even yet sure if I for example indexing multi values like in the test example "tags": ["Tag A", "Tag B"] and should be even possible with a null via "tags": ["Tag A", null, "Tag C"], its sure more technical not a real world example.

But maybe something like a IsEmptyCondition make sense. This would be keep in mind that "title": "" and "title": null at the end would be the same. And Empty would on multi values only match when it is [].

@alexander-schranz alexander-schranz added features New feature or request SEAL Core Seal Core related issue labels Dec 13, 2023
@alexander-schranz alexander-schranz changed the title Add Support for IsNullCondition or IsEmptyCondition [Core] Add Support for IsNullCondition or IsEmptyCondition Dec 15, 2023
@ToshY
Copy link
Contributor

ToshY commented Oct 11, 2024

I'm not even yet sure if I for example indexing multi values like in the test example "tags": ["Tag A", "Tag B"] and should be even possible with a null via "tags": ["Tag A", null, "Tag C"], its sure more technical not a real world example.

What would even be the merit in having having null in a list like that (even if it's technically possible). In the real world, what would it mean to have a null in a list? For non-associative arrays I'm not sure what the added value would be. Think more realistic use cases would be tags: null, tags: [], tags: [{key: value, key2: value2}, {key: value, key2: null}] (associative).

But maybe something like a IsEmptyCondition make sense. This would be keep in mind that "title": "" and "title": null at the end would be the same. And Empty would on multi values only match when it is [].

I'm not sure how others perceive this, but to me title: "" and title: null are two different things. Having title: "" means the title has a value and is set to "", while with title: null it has no value (maybe it was not set, missing, or not available at that time). If IsEmptyCondition would handle both "" and null, you will no longer distuingish between the two of them. Think a IsNullCondition that explicetly only handles null values would be my preference and let IsEmptyCondition handle the rest.

Like you already said, some engines probably don't allow null, so I don't know how that would be handled (maybe engines that allow null can use the IsNullCondition, and others should use IsEmptyCondition for those cases).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features New feature or request SEAL Core Seal Core related issue
Projects
None yet
Development

No branches or pull requests

2 participants