Making WordPress.org

Opened 10 years ago

Closed 9 years ago

Last modified 9 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:
Cc:

Description

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 wordpress.org/support/search/{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 schema.org 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="//www.google.com/jsapi" 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 google.search.CustomSearchControl('foo', customSearchOptions);
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.setLinkTarget(google.search.Search.LINK_TARGET_TOP);
    var options = new google.search.DrawOptions();
    options.setAutoComplete(true);
    customSearchControl.draw('cse', options);
<?php
if ( !empty($terms) ) {
        echo 'customSearchControl.execute('.json_encode($terms).');';
}
 ?>
  }, true);
</script>

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.


9 years ago

Note: See TracTickets for help on using tickets.