querydsl - How to perform MINUS operation in elasticsearch -
i'm trying create minus query mysql (dataset1-dataset2) in elasticsearch using querydsl can't find way.
anyone show me way? tx in advance
you can use bool query must , must not.
 documentation on bool query
you put query dataset1 in must , query dataset2 in must_not:
{ "bool" : {     "must" : {         dataset1     }     "must_not" : {         dataset2     } } }
for example:
{   "query": {     "filtered": {       "filter": {         "bool": {           "must": {             "range": {               "@timestamp": {                 "lte": 1467811620000,                 "gte": 1467811520000               }             }           },           "must_not": {             "term": {               "_type": "bus-api"             }           }         }       }     }   } } this return documents between 2 times, excluding of type bus-api.
Comments
Post a Comment