Create "filter" views and models to control the search filters
Updated by Lauren Walker over 9 years ago
- Status changed from New to In Progress
- Assignee set to Lauren Walker
- Target version changed from 1.6.0 to 1.7.0
- % Done changed from 0 to 50
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