I have an array of objects called results,
Every object has a property called ingredients, which is a large string containing many ingredients,
I need to get the 5 most used occurrences,
For example with this array of objects :
"results": [
{
"title": "Monterey Turkey Omelet",
"href": "http://allrecipes.com/Recipe/Monterey-Turkey-Omelet/Detail.aspx",
"ingredients": "butter, eggs, garlic, green pepper, monterey jack cheese, onions, turkey, water",
"thumbnail": "http://img.recipepuppy.com/5506.jpg"
},
{
"title": "Canadian Bacon Omelet",
"href": "http://www.recipezaar.com/Canadian-Bacon-Omelet-309202",
"ingredients": "butter, canadian bacon, cheddar cheese, eggs, garlic, onions, potato, red pepper, sour cream",
"thumbnail": ""
}]
I need to get butter (2), garlic (2), eggs (2), onions (2), turkey (1)