neo4j-graphql-js
neo4j-graphql-js copied to clipboard
Support for case insensitive search using the augmented filters
When I use the following query, the search is not case sensitive. For example, I want to search for "New Arrivals" or "new arrivals", But that is not possible now. Any solutions or workarounds?
I have an ugly workaround which is to duplicate the field (tagslower whose values are all lowercase characters). But looking for a scalable solution.
gql`
query($tag: String!) {
Product(filter: { tags_contains: $tag }) {
title
}
}
`;
Classic case-insensitive searching is to simply downcase both the field and the query string on comparison.
@Joshfindit And how should be that fact helpful in this case? Because there seems to be no way to control downcasing within generated resolvers, amirite?
The huge issue here is that all the generated String filters are completely useless in real case scenarios since they are case sensitive.
+1 to controlling this through makeAugmentedSchema
config.
@smajl
@Joshfindit And how should be that fact helpful in this case? Because there seems to be no way to control downcasing within generated resolvers, amirite?
The huge issue here is that all the generated String filters are completely useless in real case scenarios since they are case sensitive.
+1 to controlling this through
makeAugmentedSchema
config.
By "+1 to controlling this through makeAugmentedSchema
config." you mean you managed to do it? We're trying to get around this issue...
@fguille94 No, I meant that it should be ideally configurable via the makeAugmentedSchema
config, where you should be able to toggle case insensitive search to make it usable in real apps. Sadly can't help you more, because we are not using this lib anymore (guess why).
@smajl yeah that would certainly add more value to the lib...
We have tried adding a "searchString" prop to some entities with some of the most important prop strings separated by blank space, and in lower case, so we can just do "searchString_contains" and be done with it, but that isn't the most optimal way.
Also using @cypher
to do it eliminates the field from the filter options so it isn't usable there.
Would you care to point me in the direction you took in order fulfill this app requirement?
https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608