Regarding $location.search, the docs say,
Return search part (as object) of current url when called without any parameter.
In my
If your $location.search() is not working, then make sure you have the following:
1) html5Mode(true) is configured in app's module config
appModule.config(['$locationProvider', function($locationProvider) {
$locationProvider.html5Mode(true);
}]);
2) is present in your HTML
...
References: