ElasticSearch (2.2) Java filter between startDate and endDate if exists
问题 I want to have following filter with elasticsearch (java client): If startDate exists and lower then now If endDate exists and greater then now I already have following but it doesn't show the once which have no startDate or endDate: //Start date end date BoolQueryBuilder queryBuilder = new BoolQueryBuilder(); queryBuilder.filter(QueryBuilders.rangeQuery("startDate").lte("now")); queryBuilder.should(QueryBuilders.existsQuery("startDate")); queryBuilder.filter(QueryBuilders.rangeQuery("endDate