Fix test_last_version_query test
Fix resource collapse in searches