Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#417 closed defect (bug) (fixed)

Dates in support forum search results

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: normal
Component: Support Forums Keywords:


The support forum search is powered by a Google custom search, but the format of the results leave a lot to be desired. The main problem is that the date of each thread isn't shown, which makes it almost useless when you're trying to find recent discussions among the results. Is it possible to add a date to Google custom searches?

In addition, bbPress' default search functionality at{term} seems to have been disabled so you can't fall back to that.

Change History (6)

#1 @Otto42
10 years ago

Dates are shown where dates are available.

I'll look into adding metadata to the support forums so that things like dateModified will be available for the searches to show.

#2 @joostdevalk
9 years ago

We should just add date filtering to the search results box. I've just pasted the following code to @ocean90 that should add that:

<script src="//" type="text/javascript"></script>
<script type="text/javascript">
  google.load('search', '1', {language : 'en'});
  google.setOnLoadCallback(function() {
    var orderByOptions = {};
    orderByOptions['keys'] = [{label: 'Relevance', key: ''} , {label: 'Date', key: 'date'}];
	customSearchOptions['enableOrderBy'] = true;
	customSearchOptions['orderByOptions'] = orderByOptions;
    var customSearchControl = new'foo', customSearchOptions);
    var options = new;
    customSearchControl.draw('cse', options);
if ( !empty($terms) ) {
        echo 'customSearchControl.execute('.json_encode($terms).');';
  }, true);

The only problem is that it's incredibly hard to test this without LIVE testing it, so that's what we should do, I guess :)

#3 @joostdevalk
9 years ago

Fixed by @ocean90 using this code I think :) I can't close it as fixed though, who can?

This ticket was mentioned in Slack in #meta by joostdevalk. View the logs.

9 years ago

#5 @Otto42
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

This ticket was mentioned in Slack in #meta by joostdevalk. View the logs.

8 years ago

Note: See TracTickets for help on using tickets.