[Solved] Elasticsearch bool query sort by date if status is true
Two things regarding the mapping: There’s an address field there that’s not found in your actual documents. Remove it. Your dates should be mapped correctly using the date datatype. A correct mapping would look like this: { “properties”:{ “end_date”:{ “type”:”date”, “format”:”yyyy-MM-dd” }, “start_date”:{ “type”:”date”, “format”:”yyyy-MM-dd” }, //…other properties } } Once you get the mapping … Read more