Data bag search not returning all items

Can anybody tell me why a data bag search wouldn't return all the items that it should return? Previously this same search returned all our users, and now it returns only a small number of users. Eg:

chef (14.10.9)> search('users', '*:*').length
 => 6 


$ knife data bag show users | wc -l


Can you let me know where did you run the fist command from?
search('users', ':').length

Is it from inside the recipe file?


Well, i still have no clue why knife data bag show users returned different results than search(... showed me, but after doing knife data bag from file users data_bags/users/* , search does now show me the expected results.

Problem solved I guess.

I used search('users', ':').length in chef-shell just as a diagnostic. My real usage of search is inside a recipe, yes, specifically this:

And I still have no clue why search returned different results than knife data bag returned, but after re-uploading all my user's data bags search is working as expected now. Weird, but it's working again.