I'm having an index named as recipe in which I have a document like this
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [
{
"_index" : "recipe",
"_type" : "default",
"_id" : "AWyW-Vo64wb-rcXk0BW7",
"_score" : 1.0,
"_source" : {
"[{"Timings":{"totalTime":"PT10M","cookTime":"PT5M","id":null,"prepTime":"PT5M"},"SkillLevel":"Easy","Keywords":["Cannellini bean","Cannellini beans","Mash","Beans","Super healthy","Pulses","5-a-day","Low fat","Diet","Dieting","Side dish","Bangers and mash","Sausage and mash","Texture","Fireworks","Pesto","Easy","Vegetarian","Healthy","Bonfire Night"],"Category":["Side dish","Dinner"],"Nutrition":"per serving","MakingMethod":["Heat the oil in a large saucepan. Add the beans and cook for 3-4 mins until hot through. Lightly mash with a potato masher for a chunky texture. Stir through the pesto and season. To serve, drizzle with a little olive oil, if you like."],"Cousine":"British","Channel":"Recipe","Rating":{"bestRating":5,"ratingValue":4.625,"id":null,"ratingCount":8,"worstRating":1},"Ingredients":["1 tbsp olive oil, plus a drizzle to serve (optional)","2 x 400g cans cannellini beans, rinsed and drained","2 tbsp pesto"],"Servings":"Serves 4","Title":"Bean & pesto mash","Publication":{"eval":false,"additionalInfo":"","id":null,"published":"","value":"","url":""},"recipe_url":"https://www.techno-homes.com/recipes/1742637/bean-and-pesto-mash","Author":{"eval":false,"additionalInfo":"Recipe from Good Food magazine, ","description":"Substitute potatoes with pulses for a healthy alternative mash with a chunky texture","id":null,"published":"November 2011","value":"Techno Homes","url":"https://www.techno-homes.com/publication/good-food-0"},"id":79,"NutritionContents":{"kcal":183,"sugars":"3g","salt":"0.84g","carbs":"25g","protein":"11g","fat":"5g","saturates":"1g","id":0,"fibre":"7g"}}]" : ""
}
},
{
"_index" : "recipe",
"_type" : "default",
"_id" : "AWyXHv2W4wb-rcXk0BW9",
"_score" : 1.0,
"_source" : {
"[{"Timings":{"totalTime":"PT10M","cookTime":"PT5M","id":null,"prepTime":"PT5M"},"SkillLevel":"Easy","Keywords":["Cannellini bean","Cannellini beans","Mash","Beans","Super healthy","Pulses","5-a-day","Low fat","Diet","Dieting","Side dish","Bangers and mash","Sausage and mash","Texture","Fireworks","Pesto","Easy","Vegetarian","Healthy","Bonfire Night"],"Category":["Side dish","Dinner"],"Nutrition":"per serving","MakingMethod":["Heat the oil in a large saucepan. Add the beans and cook for 3-4 mins until hot through. Lightly mash with a potato masher for a chunky texture. Stir through the pesto and season. To serve, drizzle with a little olive oil, if you like."],"Cousine":"British","Channel":"Recipe","Rating":{"bestRating":5,"ratingValue":4.625,"id":null,"ratingCount":8,"worstRating":1},"Ingredients":["1 tbsp olive oil, plus a drizzle to serve (optional)","2 x 400g cans cannellini beans, rinsed and drained","2 tbsp pesto"],"Servings":"Serves 4","Title":"Jamshaid","Publication":{"eval":false,"additionalInfo":"","id":null,"published":"","value":"","url":""},"recipe_url":"https://www.techno-homes.com/recipes/1742637/bean-and-pesto-mash","Author":{"eval":false,"additionalInfo":"Recipe from Good Food magazine, ","description":"Substitute potatoes with pulses for a healthy alternative mash with a chunky texture","id":null,"published":"November 2011","value":"Techno Homes","url":"https://www.techno-homes.com/publication/good-food-0"},"id":80,"NutritionContents":{"kcal":183,"sugars":"3g","salt":"0.84g","carbs":"25g","protein":"11g","fat":"5g","saturates":"1g","id":0,"fibre":"7g"}}]" : ""
}
}
]
}
}
I want to perform a search over this. The search string should be searched in the whole document and the part which contains that string should be returned from the document.
I've tried multiple ways but can't figure it out. How am I supposed to do that? Please help me figure this out. I've posted a question over stackoverflow as well which is available over this link