Why does Spotlight not return the correct result?

2

enter image description here

I dont know if the search features on most operating system is bogus or I am getting it wrong.

I am looking for a particular file where css property is set like

left:-59px;

I perform search on current folder and type -59px. It give me a bunch of files. The file names does not contain -59 like in auction_rate.html and when I open the file and search for -59px, it says "nothing found".

So my question is, is that search feature really bogus or am I getting it wrong?

hk_

Posted 2012-03-24T17:50:19.373

Reputation: 1 878

Answers

1

Well, any typical search engine takes the minus/hyphen as the NOT operator, therefore you're searching for anything not containing what you entered.

In fact, Spotlight supports boolean queries. If you type foo bar, it'll search for foo AND bar. If you type foo | bar, it'll search for foo OR bar. And if you type -59px;, it'll search for NOT 59px;.

To get exactly what you entered, just search for left:-59px;.

slhck

Posted 2012-03-24T17:50:19.373

Reputation: 182 472

so it search the file contents by default? – hk_ – 2012-03-25T14:14:57.397

And the title! You can so custom searches of course. – slhck – 2012-03-25T19:52:58.757

also I could have used "-59x" in quotes – hk_ – 2012-03-26T01:12:06.470