Reputation: 995
We have an index on first name of patients
CREATE INDEX ON :Patient(FIRST_NAME)
One of our services finds patients whose name starts with say XYZ(case insensitive):
match (n:Patient) where n.FIRST_NAME=~'(?i)XYZ.*' return n
We have billions of Patient nodes. I am not sure if the index is used at all for this.
Is there a way to leverage the Lucene index and execute this any faster ? We are open to using Java API for this too.
Upvotes: 1
Views: 395
Reputation: 33145
The index would not be used for that, yet. Currently, the new label-based indexes can only do exact lookups. You could still use a legacy index or a legacy auto-index, and use the START clause to do this sort of thing, with the full-text style lucene syntax, instead of regex. If you're using REST, see an example to create an automatic node full-text index here:
Upvotes: 2