Filter by availability
This query is used to filter restaurants by availability. The query will return restaurants that have availability on a specific date and time and have at least 5 available seats for adults.
Parameters:
availability.date_time: The date and time of the availability.availability.adult: The number of available seats for adults.
// GET restaurants/_search
{
"query": {
"bool": {
"must": [],
"should": [],
"filter": [
{
"nested": {
"path": "availability",
"query": {
"bool": {
"filter": [
{
"term": {
"availability.date_time": "2024-05-24T13:30"
}
},
{
"range": {
"availability.adult": {
"gte": 5
}
}
}
]
}
}
}
}
]
}
},
"sort": [
{
"_score": {
"order": "desc"
},
"top_gmv": {
"order": "desc"
}
}
],
"size": 10,
"from": 0,
"_source": {
"include": [
"id",
"name_en",
"name_th",
"name_cn",
"availability"
]
}
}
Filter by cuisines & dining_styles
This query is used to filter restaurants by cuisines and dining styles. The query will return restaurants that serve at least one of the specified cuisines and have at least one of the specified dining styles.
Parameters:
cuisines.id: The IDs of the cuisines.dining_styles.id: The IDs of the dining styles.primary_cuisine.id: The IDs of the primary cuisines.primary_dining_style.id: The IDs of the primary dining styles.
// GET restaurants/_search
{
"query": {
"bool": {
"must": [
{
"terms": {
"cuisines.id": [
"11",
"15"
]
}
},
{
"terms": {
"dining_styles.id": [
"1643",
"1645"
]
}
}
],
"should": [
{
"terms": {
"primary_cuisine.id": [
"11",
"15"
]
}
},
{
"terms": {
"primary_dining_style.id": [
"1643",
"1645"
]
}
}
],
"filter": []
}
},
"sort": [
{
"_score": {
"order": "desc"
},
"top_gmv": {
"order": "desc"
}
}
],
"size": 10,
"from": 0,
"_source": {
"include": [
"id",
"name_en",
"name_th",
"name_cn",
"availability",
"cuisines",
"dining_styles"
]
}
}
Filter by price_range
This query is used to filter restaurants by price range. The query will return restaurants that have a price range that falls within the specified range.
Parameters:
price_per_person.lowest_price: The minimum price per person.price_per_person.highest_price: The maximum price per person.
// GET restaurants/_search
{
"query": {
"bool": {
"must": [],
"should": [
{
"range": {
"price_per_person.lowest_price": {
"gte": 0,
"lte": 2000
}
}
},
{
"range": {
"price_per_person.highest_price": {
"gte": 0,
"lte": 2000
}
}
}
],
"filter": []
}
},
"sort": [
{
"_score": {
"order": "desc"
},
"top_gmv": {
"order": "desc"
}
}
],
"size": 10,
"from": 0,
"_source": {
"exclude": [
"id",
"name_en",
"name_th",
"name_cn",
"price"
]
}
}