Relevance Output Query

Hello All,

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”

Regards,
Manish Singh

The most likely issue is that the file does not exist.

2 Likes

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

File is present on the server end.
“‪/tmp/netcool.txt”

After changing to plural statement, I am now getting only the time stamp as below

Evaluation time: 0.298 ms

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”