You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
query {
Product(filter: {name_contains: "iphone"}) {
id
type: __typename
name
isRepresentedAs {
rating
isMany
timestamp
Page {
id
name
description
isRepresentationOf {
Product {
id
name
}
}
}
}
}
}
if my product is stored as "iPhone" or "IPHONE" in the database the above filter is useless...
it is easy to lowercase the searchstring in the application layer but the whole filter is currently implemented case sensitive, which limits its practical usability.
Could the value be wrapped in toLower() cypher string function before applying CONTAINS ?
Thanks for the great work!
The text was updated successfully, but these errors were encountered:
Hi @pmualaba - this is certainly useful functionality, however wrapping in a toLower() call would mean that an index could not be used for the comparison, which would significantly impact performance for larger datasets. Ideally we can expose this functionality through a fulltext index, which would ensure performant filtering for case insensitive comparisons. We had some thoughts on this in #266
You can accomplish this functionality now by creating a Query field using a @cypher directive.
type Query {
productContains(searchString: String): [Product] @cypher(statement: """
MATCH (p:Product)
WHERE toLower(p.name) CONTAINS toLower($searchString)
RETURN p
"""
}
Hi @johnymontana, we are also having some issues regarding case sensitive search using the _contains filter. The schema we're using is rather large and we are developing a flexible search interface which should be able to search on almost any field.
Would there be any downside by adding a new filter type which uses the regex operator?
Query
if my product is stored as "iPhone" or "IPHONE" in the database the above filter is useless...
it is easy to lowercase the searchstring in the application layer but the whole filter is currently implemented case sensitive, which limits its practical usability.
Could the value be wrapped in toLower() cypher string function before applying CONTAINS ?
Thanks for the great work!
The text was updated successfully, but these errors were encountered: