Hi Below is my data.
{
"took" : 5,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 2,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "resturant",
"_type" : "_doc",
"_id" : "135569",
"_score" : 1.0,
"_source" : {
"id" : "135569",
"name" : "pizza hut",
"location" : [
-118.396294,
33.8787
],
"categories" : [
"Fast Food",
"FamilyStyle",
"Chinese"
],
"menu" : [
{
"name" : "Build Your Own Plate - 1 Full Side",
"id" : 6226,
"price" : 10.05
},
{
"name" : "Build Your Own Bigger Plate - 1 Full Side",
"id" : 6228,
"price" : 11.85
},
{
"name" : "Build Your Own Bowl - 1 Full Side",
"id" : 6230,
"price" : 8.25
},
{
"name" : "Family Feast - 2 Full Sides",
"id" : 6232,
"price" : 44.7
},
{
"name" : "Chicken Egg Roll",
"id" : 6234,
"price" : 2.35
},
{
"name" : "Side Fried Rice",
"id" : 6238,
"price" : 4.15
},
{
"name" : "Veggie SpringRoll",
"id" : 6247,
"price" : 2.35
},
{
"name" : "Dasani Bottle",
"id" : 6261,
"price" : 2.3
}
],
"facility" : "take_out",
"city" : "Manhattan Beach",
"state" : "CA",
"zip" : "90266",
"rating" : 4.5
}
},
{
"_index" : "resturant",
"_type" : "_doc",
"_id" : "18220",
"_score" : 1.0,
"_source" : {
"id" : 18220,
"name" : "Shade Hotel Manhattan Beach",
"location" : [
-118.408875,
33.886745
],
"categories" : [
"Contemporary Casual",
"Family Style",
"Brunch / Breakfast",
"American"
],
"menu" : [
{
"name" : "Chicken and Waffle Bites Breakfast Plate",
"id" : 6264,
"price" : 17
},
{
"name" : "Avocado Toast",
"id" : 6267,
"price" : 19
},
{
"name" : "Breakfast Pizza",
"id" : 6270,
"price" : 19
},
{
"name" : "Crispy Calamari Lunch",
"id" : 6274,
"price" : 17
},
{
"name" : "Roasted Squash Veggie Bowl Lunch",
"id" : 6279,
"price" : 19
},
{
"name" : "Beyond Burger Lunch",
"id" : 6284,
"price" : 21
},
{
"name" : "Spicy Hawaiian Pizza Lunch",
"id" : 6291,
"price" : 20
},
{
"name" : "The Burrito",
"id" : 6292,
"price" : 18
},
{
"name" : "Buttermilk Pancakes",
"id" : 6294,
"price" : 15
},
{
"name" : "Truffle Fries",
"id" : 6301,
"price" : 11
},
{
"name" : "Roasted Squash Veggie Bowl",
"id" : 6306,
"price" : 19
},
{
"name" : "Fried Jidori Chicken Sandwich",
"id" : 6310,
"price" : 19
},
{
"name" : "Spicy Hawaiian Pizza",
"id" : 6315,
"price" : 20
},
{
"name" : "Carnitas Street Tacos",
"id" : 6322,
"price" : 14
},
{
"name" : "Roasted Squash Veggie Bowl Dinner",
"id" : 6327,
"price" : 19
},
{
"name" : "Spicy Hawaiian Pizza Dinner",
"id" : 6332,
"price" : 20
},
{
"name" : "Prime Rib DipDinner",
"id" : 6342,
"price" : 21
}
],
"facility" : [
"indoor_dining",
"outdoor_sitting",
"take_out"
],
"city" : "ManhattanBeach",
"state" : "CA",
"zip" : "90266",
"rating" : 5
}
}
]
}
}
Now I want to search name and menu with word pizza.
I am trying to search with the below search query but I give zero results.
curl -XGET 192.168.10.107:9200/resturant/_search?pretty -d '{
"query": {
"bool": {
"must": [
{
"match": {
"name": "pizza"
}
},
{
"nested": {
"path": "menu",
"query": {
"bool": {
"must": [
{ "match": { "menu.name": "pizza" } }
]
}
}
}
}
]
}
}
}'