Katello/katello — pull request #291 by parthaa (2012-07-05 21:09:59+00:00)
Title: Shared unique

Content search server side shared vs unique
To search for 'unique' packages across environments with ids 1,5,6 you would set the mode parameter to unique. For example
```javascript
$.ajax({
type: 'POST',
contentType:"application/json",
url: "/katello/content_search/packages",
data: JSON.stringify({"repos":{"search":""}, "content_type":"packages", "packages":{"search":"*"}, "environments":[1,5,6], "mode" :"unique"}),
success: function(data){
console.log(data);
}
});
```

Similarly to search for 'shared' packages across environments with ids 1,5,6, you would set the mode parameter to shared. For example
```javascript
$.ajax({
type: 'POST',
contentType:"application/json",
url: "/katello/content_search/packages",
data: JSON.stringify({"repos":{"search":""}, "content_type":"packages", "packages":{"search":"*"}, "environments":[1,5,6], "mode" :"shared"}),
success: function(data){
console.log(data);
}
});
```

Json structure outputted will be same as the traditional response to the all packages call that happens for default search, except for the fact data will be returned only for the selected environments.

Will be writing the spec in the next pull request.