Skip to content

Commit

Permalink
fix: event listing w/ keyword date sort and filter
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefilter committed Aug 8, 2023
1 parent 9e04bec commit 5b85897
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions plugins/data-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion utils/searchConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const config = {
} */
],
resultFields: ["*"],
sortField: "title.keyword",
sortField: "startDateWithTime",
orderBy: "asc",
},
}
Expand Down

0 comments on commit 5b85897

Please sign in to comment.