Hi, we have index with two field firstDate and endDate and i need to execute request that match all documents that
endDate gte somedate1value and firstDAte lte somedate2value
How can ? write my query?
thanks
Hi, we have index with two field firstDate and endDate and i need to execute request that match all documents that
endDate gte somedate1value and firstDAte lte somedate2value
How can ? write my query?
thanks
You can use a RangeFilter
Bonjour David,
c'est ce que j'ai fait. ci-après mon code: Mais ça donne pas satisfaction
#################
FilterBuilder filter1 = FilterBuilders.rangeFilter("dateFin").gt(df.format(getDateDebutRecherche()));
FilterBuilder filter2 = FilterBuilders.rangeFilter("dateDebut").lt( df.format(getDateFinRecherche()));
client=ClientProvider.getTransportClient();
SearchResponse response = client.prepareSearch(INDEX_NAME).setTypes(TYPE_NAME).
setQuery(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(),FilterBuilders.andFilter(filter1,filter2)))
.execute()
.actionGet();
#####################"
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.