fixes to allow the index to be passed back to the search in case resource_id is not the unique key
added in sorting fix, [touch: 35-hipchat-source]
cleaning up the old enumeration for cleaner code
Merge pull request #1 from fredkingham/master

allow the index to be passed back to the search