Instant Search: Add filtering display#13371
Conversation
…earch Everything seems to work.
|
OK, I think I got all of this working now. @jsnmoon I decided to just pass the whole options object into SearchWidget because it felt like we should do the checking for whether or not options exist inside the app. Have to handle cases where there is no search widget configured in which case there will be no aggregations or widgets defined. I think I did this in a reasonable way... |
jsnmoon
left a comment
There was a problem hiding this comment.
Looks good, left a small comment that we can address in a future polish PR; should be good to go after a quick lookover from @bluefuton.
| this.requestId = 0; | ||
| this.props.resultFormat = 'minimal'; | ||
| this.props.aggregations = buildFilterAggregations( this.props.options.widgets ); | ||
| this.props.widgets = this.props.options.widgets ? this.props.options.widgets : []; |
There was a problem hiding this comment.
It's probably not a big deal since we're only doing this once in the constructor, but React Props are meant to be read-only.
Perhaps it'd be better to use a memoized accessor method like SearchApp.getAggregations? Or directly reference this.props.options.widgets when we need to access values from within options.
We can leave this alone for now, I think.
|
It'd be good to format the date filter label according to the period selected (dropping the time in all cases), but we can change that later 👍 |
* Implement minimal search results and spelling correction (#13365) * Add filtering display (#13371) * Fix search result display bugs and make improvements (#13393) * Add rudimentary support for filtering on post types (#13430) * Add support for filtering on categories and tags (#13505) * Add instant search sorting based on the URL (#13377) * Add support for filtering on dates (#13545) * Add custom taxonomy filtering (#13605) * add sort widget (#13614) * fix many theme incompatibilities (#13602) * Add infinite scrolling (#13684) * Add caching to the api requests (#13714) * Clean up some design bugs/issues (#13721) * Fix labels for post types when we have them. (#13750) * Add localization and formatting of all dates (#13748) * search from any page on the site (#13713) * Hook up default options (inc. sort) (#13742) * Add TrainTracks analytics (#13730) * Create PostTypeIcon component (#13790) * Upgrade to Preact 10 (#13794) * Add comments component (#13797) * Address review feedback

This is the same as #13332 but merging into instant-search-master rather than master.
Adds the display of filters to the search widget. Still a fair bit of work to do here, but trying to merge it into the feature branch so I can use the better API code in other places (sorting for instance).