cancel
Showing results for 
Search instead for 
Did you mean: 

I can't use IgnoreCase in Neo4JRepositories

Ultrayano
Node

We'd like to use case insensitivity searches in our project with the help of Neo4JRepositories, but we don't have the option to do so. The feature should be in SDN since version 5.2.0.M2 (2019-03-07). We're using version 5.2.5.RELEASE as of now.

We'd like to use it like this:

@Repository
interface LocationsRepository extends Neo4jRepository<Location, String> {
    List<Location> findByNameIgnoreCase(String location);
}

but are currently using a workaround with regex.

3 REPLIES 3

gerrit_meier
Neo4j
Neo4j

I just ensured with exactly this version that it generates the right query like
MATCH (n:Location) WHERE toLower(n.name) = toLower($location) RETURN ...
Could you turn debug logging on for org.neo4j.ogm and look what query do you get generated when executing the method above?

It works! But it seems like IntelliJ has no auto-completion for the IgnoreCase in findBy..IgnoreCase.

Another question. Is it possible to make a query with startsWith?
findByNameIsStartingWithIgnoreCase(String string) doesn't seem to work.

Unable to ignore case of java.lang.String types, the property 'name' must reference a String

This is not yet supported but we think it should.
There is now a ticket that is also kind of already solved but we also need to release new service versions of Neo4j-OGM 3.1 and 3.2 to make this work throughout the stack.