hw2 (part 1): done ex1, ex2

This commit is contained in:
Claudio Maggioni 2023-04-24 10:26:23 +02:00
parent d060e66518
commit 24d8a8c3e2
2 changed files with 58 additions and 4 deletions

View file

@ -3,14 +3,30 @@ GET /restaurants/_search
"query": {
"bool": {
"must": [
{ "match": { "name": "pizza" } }
{
"match": {
"name": "pizza"
}
}
],
"should": [
{ "match": { "ratingText": "Very Good" } },
{ "match": { "ratingText": "Excellent" } }
{
"match": {
"ratingText": "Very Good"
}
},
{
"match": {
"ratingText": "Excellent"
}
}
],
"must_not": [
{ "match": { "name": "pasta" } }
{
"match": {
"name": "pasta"
}
}
]
}
}

View file

@ -0,0 +1,38 @@
GET /restaurants/_search
{
"query": {
"bool": {
"must": [
{
"regexp": {
"name": {
"value": ".*pizz.*",
"flags": "ALL",
"case_insensitive": true
}
}
}
],
"must_not": [
{
"regexp": {
"name": {
"value": ".*pizza.*",
"flags": "ALL",
"case_insensitive": true
}
}
},
{
"regexp": {
"name": {
"value": ".*pizzeria.*",
"flags": "ALL",
"case_insensitive": true
}
}
}
]
}
}
}