Problems with count() after deleting

Hi,
I have an xquery which checks if a user exists by counting the number of users found like so:

let $a := input()/user[uid = 'rpuddephatt'] return count($a)

I have recently deleted the user rpuddephatt and still count shows as 1. If I enter a fake user count() returns 0 as expected. I have tried this from the Java API, X-Plorer and pointing a URL at the database directly with the _xql parameter, but no joy

I return $a from the query above it shows nothing as expected. I restarted the database in a hope that it was caching, but this was not the case.

Is this a bug with the count() function of am I doing something wrong?
[/code]

Hi,
I have run _admin=ino:RecreateIndex(“hr-record”,“user”), this sorted the problem, so this seems like a bug with the indexing, which count is using for the xquery