elasticsearch - Match Or Ignore -


i've following simple configuration:

{ "query": {     "bool": {         "must": [{             "term": {                 "foo": "bar"                 }             }, {             "term": {                 "relation.id": 300                 }             }, {             "nested": {                 "path": "my_types",                     "filter": {                     "bool": {                         "must": [{                             "range": {                                 "my_types.type_date": {                                     "from": "2010-01-01",                                         "to": "2016-12-31"                                     }                                 }                             }]                         }                     }                 }             }]         }     } } 

this works fine.

how deal missing input in dynamic config? possibly, value bar empty, want remove/ignore condition, below. same type_date. possibly, have 2016-12-31 end date no start date.

{ "query": {     "bool": {         "must": [{             "term": {                 "foo": "" // want ignore                 }             }, {             "term": {                 "relation.id": 300                 }             }, {             "nested": {                 "path": "my_types",                     "filter": {                     "bool": {                         "must": [{                             "range": {                                 "my_types.type_date": {                                     "from": "", // want ignore                                         "to": "2016-12-31"                                     }                                 }                             }]                         }                     }                 }             }]         }     } } 

question: how filter exact value or ignore condition?


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -