diff --git a/plugins/data-api.js b/plugins/data-api.js index c7c6614a8..7939961a3 100644 --- a/plugins/data-api.js +++ b/plugins/data-api.js @@ -317,6 +317,19 @@ export default function ({ $config }, inject) { sectionHandleTermQueryObj["query_string"] = {} sectionHandleTermQueryObj["query_string"]["query"] = sectionHandle boolQuery.push(sectionHandleTermQueryObj) + + if (sectionHandle == "sectionHandle:event OR sectionHandle:exhibition OR sectionHandle:eventSeries") { + boolQuery.push( + { + "range": { + "endDateWithTime": { + "gte": "now", + } + } + } + ) + } + // console.log("query:" + boolQuery) return boolQuery } diff --git a/utils/searchConfig.js b/utils/searchConfig.js index ecf4a854d..3fce82f9a 100644 --- a/utils/searchConfig.js +++ b/utils/searchConfig.js @@ -266,7 +266,7 @@ const config = { } */ ], resultFields: ["*"], - sortField: "title.keyword", + sortField: "startDateWithTime", orderBy: "asc", }, }