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 9, 2023
1 parent 96d0775 commit cb24f2b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pages/visit/events-exhibitions/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ export default {
config.eventsExhibitionsList.sortField,
config.eventsExhibitionsList.orderBy,
config.eventsExhibitionsList.resultFields,
config.eventsExhibitionsList.filters
config.eventsExhibitionsList.filters,
config.eventsExhibitionsList.extraFilters,
)
//console.log("getsearchdata method:" + JSON.stringify(results))
// this.events = []
Expand Down
4 changes: 3 additions & 1 deletion plugins/data-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ export default function ({ $config }, inject) {
sort,
orderBy,
source = ["*"],
aggFields = []
aggFields = [],
extraFilters = [],
) {
//var data_url = new URL(`${ES_URL}/apps-dev-library-website/_search`)
console.log("In data api keywordsearchwithfilters")
Expand Down Expand Up @@ -201,6 +202,7 @@ export default function ({ $config }, inject) {
},
...parseSectionHandle(sectionHandle),
...parseFilterQuery(filters),
...extraFilters,
],
},
},
Expand Down
12 changes: 11 additions & 1 deletion utils/searchConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,18 @@ const config = {
inputType: "date",
} */
],
extraFilters: [
// no manual control
{
"range": {
"endDateWithTime": {
"gte": "now",
},
},
},
],
resultFields: ["*"],
sortField: "title.keyword",
sortField: "startDateWithTime",
orderBy: "asc",
},
}
Expand Down

0 comments on commit cb24f2b

Please sign in to comment.