I am running below relevance query but getting output as "Error: Singular expression refers to nonexistent object.".
Please suggest what might be wrong in below relevance
if (exists (computer name) whose (it as string as lowercase = “xyz” as lowercase))or (exists (computer name) whose
(it as string as lowercase = “xyz1” as lowercase)) then lines of file “/tmp/netcool.txt” else lines of file “/tmp/netcool1.txt”
Agreed. There are various ways of addressing that, but here’s one relatively simple one (pluralize the object):
if (exists (computer name) whose (it as string as lowercase = "xyz" as lowercase)) or (exists (computer name) whose (it as string as lowercase = "xyz1" as lowercase)) then lines of files "/tmp/netcool.txt" else lines of files "/tmp/netcool1.txt"
The following is good reference to better understanding errors returned by relevance statements and troubleshooting them: Common Relevance Error Messages
What do these queries give? Breaking down a query into its components is often an effective way to understand what’s happening.
Q: computer name
Q: (exists (computer name) whose (it as string as lowercase = "xyz" as lowercase)) or (exists (computer name) whose (it as string as lowercase = "xyz1" as lowercase))
Q: exists file “/tmp/netcool.txt”
Q: exists file “/tmp/netcool1.txt”
Q: lines of file “/tmp/netcool.txt”
Q: lines of file “/tmp/netcool.txt”