目录
intervals 满足不同部分Query
POST _search
{
"query": {
"intervals": {
"my_text": {
"all_of": {
"ordered": true,
"intervals": [
{
"match": {
"query": "my favourite food",
"max_gaps": 0,
"ordered": true
}
},
{
"any_of": {
"intervals": [
{
"match": {
"query": "hot water"
}
},
{
"match": {
"query": "cold porridge"
}
}
]
}
}
]
},
"_name": "favourite_food"
}
}
}
}
POST _search
{
"query": {
"intervals" : {
"my_text" : {
"match" : {
"query" : "hot porridge",
"max_gaps" : 10,
"filter" : {
"not_containing" : {
"match" : {
"query" : "salty"
}
}
}
}
}
}
}
}
POST _search
{
"query": {
"intervals" : {
"my_text" : {
"match" : {
"query" : "hot porridge",
"filter" : {
"script" : {
"source" : "interval.start > 10 && interval.end < 20 && interval.gaps == 0"
}
}
}
}
}
}
}
POST _search
{
"query": {
"intervals" : {
"my_text" : {
"match" : {
"query" : "salty",
"filter" : {
"contained_by" : {
"match" : {
"query" : "hot porridge"
}
}
}
}
}
}
}
}
POST _search
{
"query": {
"intervals": {
"my_text": {
"all_of": {
"intervals": [
{
"match": {
"query": "the"
}
},
{
"any_of": {
"intervals": [
{
"match": {
"query": "big"
}
},
{
"match": {
"query": "big bad"
}
}
]
}
},
{
"match": {
"query": "wolf"
}
}
],
"max_gaps": 0,
"ordered": true
}
}
}
}
}
POST _search
{
"query": {
"intervals": {
"my_text": {
"any_of": {
"intervals": [
{
"match": {
"query": "the big bad wolf",
"ordered": true,
"max_gaps": 0
}
},
{
"match": {
"query": "the big wolf",
"ordered": true,
"max_gaps": 0
}
}
]
}
}
}
}
}
match/multi_match/should/match_bool_prefix
GET /_search
{
"query": {
"match": {
"mess