Hi Dave
It as working fine until either the upgrade to 3.1 or to the latest version of live search. I did them both at the same time so I can’t tell you which one changed things.
… Stop the presses, I think you can blame me for this one. I checked it in Chrome, where I am logged in and the search results returned drafts. Then I thought I’d check it in a browser where I wasn’t logged in so I used the Chrome Canary build. It runs as a separate process but it perhaps seems to share a cookie or 2 with the Mainstream version of Chrome. I’m not actually logged in in the Canary build. Odd
It behaves as expected in Internet Exploder (not logged in).
… ah, dammit, This just gets silly now. I’m thinkong of blaming WordPress at this stage. I tried it in Firefox, not logged in, and got all the drafts. Cleared all my cookies, got all the drafts. I cleared the active logins & restarted the browser – same thing. The page is cached and is the same html in Canary, Fireofx and IE8 so I dunno why IE doesn’t work the same (ok, I do but it’s not a nice thing to say).
I added the extra line from your first post and now it works fine, as expected. It shows me the drafts if I am logged in, which is kinda nice but was unexpected after I added the line to filter only published posts. I wonder if it’s a regression bug in WordPress?
I was testing it by searching for “yellow” at cadbloke.com. Let me know if it returns anything because, if it does, they’re all unpublished drafts, probably riddled with swearing.