But do you not have some domain knowledge such that for example one would not expect to see the word 'Cat' associated with a property that is a date or a float or a integer?
And then also, what if your data is such that a property represents an array as opposed to a single field.
if i understand correctly you want a single query which will traverse every node, every relationship, every property and if said element contains the word 'Cat' then return said element?
WITH toLower("cat") AS strSearch
MATCH (n)-[r]-(m)
WITH DISTINCT
[x IN keys(n) WHERE toLower(n[x]) CONTAINS strSearch | n] AS propNodeMatch,
[x IN keys(r) WHERE toLower(r[x]) CONTAINS strSearch | r] AS propRelMatch,
[x IN labels(n) WHERE toLower(x) CONTAINS strSearch | n] AS labelNodeMatch,
CASE toLower(type(r)) CONTAINS strSearch WHEN true THEN r END AS typeRelMatch
RETURN DISTINCT
propNodeMatch + labelNodeMatch AS MatchingNodes,
propRelMatch+typeRelMatch AS MatchingRels
It would need some tweaking, and performance isn't optimized, but I think it gets close to what you're looking to do.
Dear @B-D-T , sorry for replying so late, something came up that I have to deal with first. I still didn't have the time to try out your solution, but I will in the near future and get back to you! Thank you for thinking along.