hi i am trying to query in ElasticSearch wherein I want to fetch data using multiMatchQuery to search a string and rangequery to filter data between the dates
Calendar compareDate = Calendar.getInstance();
compareDate.add(Calendar.DATE, 14);
SearchQuery query = new NativeSearchQueryBuilder().withIndices("project")
.withPageable(new PageRequest(offset, limit))
.withFilter(rangeQuery("startDate").from(new Date().getTime()).to(compareDate.getTime()))
.withFilter(multiMatchQuery(string,
new String[] { "name","platform", "department", "url"}).build();
The date filter query fails and it gives me data of older dates. I tried using using booleanQueryBuilder still I got old dates. If i use rangeQuery filter without multiMatchQuery it gives me the correct data. but why this combined doesn't work? is there any work around using springdata?
my document will look like this
{
"categories": [
{
"id": "ee625703-6103-6f94-b246-ff00003e0ef8",
"name": "Networking"
}
],
"id": "PROJECT_69ee95dcb88547e388491328bbb6fdcc",
"hostContentId": "69ee95dc-b885-47e3-8849-1328bbb6fdcc",
"orgName": "Parinati Solutions",
"title": "Parinati Solutions: Kansas City",
"summary": "Parinati Solutions this is a test project name...",
"categoryUrls": "networking",
"startDate": 1512572400000,
"endDate": 1512576000000,
"friendlyDates": "Dec 6 @ 9:00 am - 10:00 am",
"friendlyLocation": "Test local Foundation, Kansas City, MO",
"providerSearchId": "9b89acbc-2d03-4526-860c-2a71f891be4b",
"contentProvider": "sourcelink",
"contentType": "PROJECT",
"linkedinProfileUrl": null,
"allowMemberContact": null,
"firstName": null,
"lastName": null,
"expertise": null,
"twitterHandle": null,
"interests": null,
"tagLine": null,
"searchResultId": "9b89acbc-2d03-4526-860c-2a71f891be4b"
}