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

GraphQL: Add a case-insensitive filter for string containment #1837

Closed
4 tasks done
lutter opened this issue Aug 6, 2020 · 9 comments
Closed
4 tasks done

GraphQL: Add a case-insensitive filter for string containment #1837

lutter opened this issue Aug 6, 2020 · 9 comments
Assignees

Comments

@lutter
Copy link
Collaborator

lutter commented Aug 6, 2020

We have a filter field_contains: "something" which matches any entity whose field contains the string "something". The comparison for that is case sensitive. It would be good to also have a filter for string containment that is not case sensitive.

@orenyodfat
Copy link

any update re that @lutter
?

@lutter
Copy link
Collaborator Author

lutter commented Dec 20, 2020

Hi @orenyodfat - I am sorry, but I haven't had time to work on this at all yet.

@remon-nashid
Copy link

A pretty important feature to have.

It's worth noting that case-insensitivity also matters for _starts_with, _ends_with and all string matching suffixes.

@morrigan
Copy link

Bumping this as well, hoping it will be added soon since the search feature is still not fully supported and this is the only similar replacement.

@azf20
Copy link
Contributor

azf20 commented Nov 26, 2021

As a user I think this is how you would expect this functionality to work. @lutter what do you think about making this the default for contains and starts_with, and introduce new _contains_strict and _starts_with_strict for exact matching? That would of course introduce some query variability between versions

@lutter
Copy link
Collaborator Author

lutter commented Nov 29, 2021

Yes, I totally agree that that is much more what users would expect. Making contains and starts_with case insensitive is a trivial change in the backend (replacing like with ilike in queries) One small wrinkle is that case-sensitivity is locale-dependent, and the response will depend on the locale in which the database is running, but that's not a new thing, we have that with ordering too. More a reminder that we need to define the locale for all these operations for the network.

@azf20
Copy link
Contributor

azf20 commented Dec 1, 2021

One small wrinkle is that case-sensitivity is locale-dependent, and the response will depend on the locale in which the database is running, but that's not a new thing, we have that with ordering too. More a reminder that we need to define the locale for all these operations for the network.

This is interesting and I hadn't considered it. Is the deterministic solution here to make the locale configurable somehow (so all indexers can set the same value)?

@lutter
Copy link
Collaborator Author

lutter commented Dec 1, 2021

This is interesting and I hadn't considered it. Is the deterministic solution here to make the locale configurable somehow (so all indexers can set the same value)?

I don't think it's something that graph-node should do. Locale can be configured easily through the environment resp. on creation of the database. We should mandate that everything runs in some fixed locale (maybe en_US.UTF8, though we'd need to look into if there are other locales that are more palatable to the non-English world) graph-node could then check on startup that its locale and the locale of the database are the expected one.

@saihaj saihaj closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

7 participants