I want to query my graph which should return the nodes which end with the word "Shock". I have two options for that, one node has the word "Shock" another has the word "Septic Shock". I want to run a single query that uses the word shock and return nodes for both of them.
match (:Symptom_Name{Name:"Shock"})-[:Causes]->(a) return a
This query just gives the answer for Shock and not septic shock.
By the way, if you only want to match to strings ending in 'shock', then you need to use 'ends with' instead of 'contains.' There is also 'starts with'
the reference card is very handy:
These string predicates are described under the 'Predicate' section on the right-hand-side.
Another option to consider would be to create a full-text index on the node or node property/label. Should be insensitive to case, unless you make it sensitive. This index effectively drops a search engine behind your neo4j DB.
Once indexed you can use the db.index.fulltext.queryNodes function with 'shock' as query string. This query should give you both nodes. If not try 'shock~', fuzzy search.
I believe you can adjust the query string to only match text that ends in 'Shock'. If you add more nodes that contain "Shock".