Create "filter" views and models to control the search filters
#1 Updated by Lauren Walker about 6 years ago
- % Done changed from 0 to 50
- Target version changed from 1.6.0 to 1.7.0
- Assignee set to Lauren Walker
- Status changed from New to In Progress
I've made some changes to the Search model so that the filters are controlled in a central location. I may still create a Filter view in the future, but for now it's not necessary.
- The query string creation is now in the search model instead of the DataCatalogView. So now the DataCatalogView (and any other view) can retrieve the query just by searchModel.getQuery(). This paves the way for the Statistics view to use the same query the data search does.
- Query strings for one filter can be retrieved in a similar way, e.g. searchModel.getQuery("creator");
- Filters can easily be removed from a theme by overriding the default Search model and removing that filter name from the "defaults" of the model. (The HTML for that filter will still need to be taken out of the search template.).
- Added an object to the search model that maps the filter name to it's associated index field name. So instead of writing a custom string for each filter such as "characteristic_sm:" + value, the model now loops through multiple filters and just grabs it's associated index field name from the map, e.g. fieldNameMap[filterName] + ":" + value