When using the module search function, at https://drupal.org/project/modules/, it's currently not possible to sort by "most installed". If "most installed" is selected, the URL argument is not added. For all other options, it works fine.

For example, if I search for "blah", I should get
https://drupal.org/project/modules/facebook%20twitter?f[0]=bs_project_sa...
But instead, I get:
https://drupal.org/project/modules/facebook%20twitter?f[0]=bs_project_sa...

I'm on linux, using firefox 17.

Comments

avpaderno’s picture

Status: Active » Closed (works as designed)

It seems to work, to me. When Sort by is set to Most installed, I get the following modules, in this exact order:

  1. Views (537800)
  2. Token (482467)
  3. Chaos tools suite (457988)
  4. Pathauto (407015)
  5. Wysiwyg (272559)
naught101’s picture

Status: Closed (works as designed) » Active

kiamlaluno: Try again, but with something in the "search modules" field.

jonanthony’s picture

#subscribe
as soon as you put some search text in you lose (or at least I do) the ability to sort by most installed. We have come to rely on this feature quite heavily to quickly establish which modules are most stable, have the longest histories, when looking for niche modules.

babbage’s picture

I likewise confirm that I have experienced this issue in the last 24 hours.

Steps to reproduce:
a) Type something into the search field (e.g., "links").
b) Click "Refine your search" and select "Modules".
c) Click "Search".
d) In the drop-down options, change "Sort by" to "Most installed". Page reloads, and now "Relevancy" is selected.
e) If any other criteria is selected for sort, the page reloads and that criteria is selected, with the sort apparently re-ordered as expected.

I initially experienced this problem in Safari on the iPhone, so thought it might be browser-specific, but have reproduced this on Safari and Firefox for Mac OS X.

drumm’s picture

Project: Drupal.org site moderators » Project ApacheSolr integration
Version: » 6.x-3.x-dev
Component: Site organization » User interface
winchendonsprings’s picture

Project: Project ApacheSolr integration » Drupal.org site moderators
Version: 6.x-3.x-dev »
Component: User interface » Site organization

I can confirm this as well. Ubuntu -Firefox -Chrome -Chromium -Opera -Midori -Epiphany

silverwing’s picture

Project: Drupal.org site moderators » Project ApacheSolr integration
Version: » 6.x-3.x-dev
Component: Site organization » User interface
mducharme’s picture

Priority: Normal » Major

Bumping up the priority. This is a must-have filter during the module selection process.

maniosullivan’s picture

Bump, have noticed this happening for some time now. Initially thought it was specific to Safari, but I have since seen the same behaviour on all browsers.

webservant316’s picture

confirming that this is still a problem

smartinm’s picture

Component: User interface » Code
Status: Active » Needs review

I've been researching this issue and found this:

In the function project_solr_browse_projects_form_submit() the Solr sort field (iss_project_release_usage) is not added to the params before the redirect to result page occurs because is the default sort:

  // Sets the Solr sort, gets query string parameters.
  if ($form_state['values']['solrsort'] !== variable_get('project_solr_default_sort', 'sort_title asc')) {
    list($sort, $direction) = explode(' ', $form_state['values']['solrsort']);
    $query->setSolrsort($sort, $direction);
    $params = array_merge($params, $query->getSolrsortUrlQuery());
  } 

However in the function project_solr_browse_page() the validate sort parameter has two bugs and does not apply the default sort:

    // Fetch our text and url values
    $text_query = arg(2);
    $sort = isset($_GET['solrsort']) ? check_plain($_GET['solrsort']) : '';
    // Validate sort parameter.
    if ((!isset($sort) || !preg_match('/^([a-z0-9_]+ (asc|desc)(,)?)+$/i', $sort)) && empty($text_query)) {
      $sort = variable_get('project_solr_default_sort', 'sort_title asc');
    }

Note:

1. isset($sort) will always evaluate to true (because isset() function treat an empty string as true)
2. If the user type something into the search field and select "most installed" sort the $text_query is not empty and the default sort is not applied (because was removed in the submit function).

Simple patch:

diff --git a/project_solr.pages.inc b/project_solr.pages.inc
index 34ef2ca..9f81e52 100644
--- a/project_solr.pages.inc
+++ b/project_solr.pages.inc
@@ -44,7 +44,7 @@ function project_solr_browse_page($term_name) {
     $text_query = arg(2);
     $sort = isset($_GET['solrsort']) ? check_plain($_GET['solrsort']) : '';
     // Validate sort parameter.
-    if ((!isset($sort) || !preg_match('/^([a-z0-9_]+ (asc|desc)(,)?)+$/i', $sort)) && empty($text_query)) {
+    if (empty($sort) || !preg_match('/^([a-z0-9_]+ (asc|desc)(,)?)+$/i', $sort)) {
       $sort = variable_get('project_solr_default_sort', 'sort_title asc');
     }
relaxpor’s picture

Confirm the problem still arise.

zajak’s picture

Priority: Major » Critical

I'm trying to drive adoption for Drupal at my university and this issue is causing some immediate questions about the quality of the framework "why should we use this framework when their own website doesn't even work right" is a response I'm getting This is STILL definitley an issue and DOES NOT work as designed.

When I search for "views" off of the home page (select modules) from the drop down radio, the default sort is by "relavancy". Top result is "Views Field View".

Sorting by "Most Installed" doesn't change anything. Still "Views Field View" is the top result. I expect to see the "Views" module as my top result. I literally have to tell people I'm training to use google to search for modules. Please Please Please fix this so I can help bring more people to this awesome framework.

smartinm’s picture

StatusFileSize
new630 bytes

Search modules on Drupal.org with this bug is a pain, but do not think that is critical.

I rerolled my patch from comment #11

drumm’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for providing a patch file.

I went ahead and committed this and deployed on staging. Please double check http://staging.devdrupal.org/, be sure to look for any unintended side effects. Also, please try out http://7.devdrupal.org/; the project_solr codebase has changed quite a bit for D7, and I think this was fixed there too.

resslx’s picture

Please fix this! It's difficult searching for effective modules otherwise.

dww’s picture

Please test this! ;) A fix has been deployed. We're asking for help testing. If this issue pisses you off, please contribute instead of just complaining.

Thanks,
-Derek

smartinm’s picture

I checked the patch on staging environment and works fine for me.

Searching "views" using sort by "Most intalled"...

- On drupal.org returns "Achievements Views" module as first result and Sort by field is changed [1].
- On staging.devdrupal.org returns "Views" module as first result and Sort by field is not changed [2].

[1] http://drupal.org/project/modules/views?f[0]=bs_project_sandbox%3A0
[2] http://staging.devdrupal.org/project/modules/views?f[0]=bs_project_sandb...

drumm’s picture

Status: Reviewed & tested by the community » Fixed

This has been deployed.

jonanthony’s picture

I tested this with the phrase mail http://staging.devdrupal.org/project/modules/mail?f[0]=bs_project_sandbo... and results worked like a charm.
One thought is that the results are ordered by the number of downloads. In an ideal world popularity would be ordered by the number of reported installs IMHO as this lets me know how well the module actually works.

Anyway big thumbs up !! Great to see this back in action.

giorgosk’s picture

Status: Fixed » Active

since this was closed as duplicate #1953680: Search Sort By option doesnt work
I will post here

searching with
Search Modules: userpoints (or any other word)
Sort by: Relevancy

gives results with sort by: most installed

I always use this kind of search and this was not the case 24hours ago

smartinm’s picture

Status: Active » Needs review
StatusFileSize
new991 bytes

The Sort By "Relevancy" (score) now does not work because getSolrsortUrlQuery() function on apachesolr.module removes the parameter of the URL.

  • project_solr module uses "most installed" as default sort.
  • apachesolr module uses "relevancy" as default sort.

The attached patch adds explicitly the "solrsort" parameter to the URL (even if it is the default).

drumm’s picture

I went ahead and committed this and it is on http://staging.devdrupal.org/ for testing. Please test this, and other sorting-related behavior.

Also, please test everything on http://git7site.devdrupal.org/. The D7 code has diverged quite a bit, and I think these problems are already solved, but more testing is always nice.

smartinm & anyone else interested – we have dev sites with read-only Solr access, so any future patches can be tried out with real data and configuration, see http://drupal.org/node/1018084.

naught101’s picture

Status: Needs review » Needs work

http://staging.devdrupal.org/ works for me for both most installed and relevancy.

On http://git7site.devdrupal.org/, when I search for a module from the front page, the "sort by" drop down says "most installed", but it's actually sorted by relevancy (BTW, this is spelled incorrectly in the drop-down). If I choose another sort, then it sorts correctly, but still displays "most installed" in the drop down. This means that "most installed" can't be selected with the AJAX interface, but it can with javascript off. Unfortunately, it appears to be sorted backwards (least installed first).

drumm’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Assigned: Unassigned » drumm
Priority: Critical » Major

Deployed the changes to production.

I corrected the spelling error and am looking into the other D7 issues.

drumm’s picture

Status: Needs work » Fixed

I fixed up the sorting with http://drupalcode.org/project/project_solr.git/commitdiff/75065157872421... and http://drupalcode.org/project/project_solr.git/commitdiff/f90ffc2f136ce0....

Indexing had stalled as well, it got caught on a node without a type which I deleted. More projects will be in the index as it updates.

drumm’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Assigned: drumm » Unassigned
Status: Fixed » Needs work

Nope, not fixed: #1991994: Relevancy not working on project search

Reminder: we have dev sites with read-only Solr access, so any future patches can be tried out with real data and configuration, see http://drupal.org/node/1018084.

giorgosk’s picture

when will this change be applied to drupal.org ?

mcfilms’s picture

I would very much like to test the better search at http://staging.devdrupal.org/. How can I access it? The pop-up log in does not accept my drupal.org username and password.

drumm’s picture

There are no pending patches for D6 right now, so http://staging.devdrupal.org/ should be the same as http://drupal.org/. As always, http://git7site.devdrupal.org/ could use testing. The http user/pass for Drupal.org staging and dev sites is drupal/drupal.

If anyone is interested in working on a new D6 fix, let me know and I'll get a dev site set up.

mcfilms’s picture

StatusFileSize
new118.59 KB

Thank you Drumm.

I can report that neither one of the development environments are returning search results that are remotely relevant. Attached is my screenshot for a search for "Ubercart." First I used the general search, when I didn't see it I refined it to search modules. I didn't change it to filter for "most installed" but it said it returned those results.

So a search for Ubercart, refined to just modules, and then sorted by relevance and the Ubercart module doesn't even show up above the fold. Apparently Google Analytics and Imagecache have more to do with Ubercart than Ubercart does.

This is moderately frustrating to me. But I am most alarmed because I can remember what it was being new to Drupal. And having to really dig to find a module isn't going to win over new devotes.

Isn't their a way to "weight" certain pages for search results in Solr? Because I think the top 100 modules should be the first thing found when you do ANY search that is a match for the module name. And if it will take manual work to make it so, I'm happy to do it if someone wants to grant me access.

dddave’s picture

drumm’s picture

Title: Can't sort module search by "most installed" » Can't sort module search by "relevance"
dddave’s picture

Closed another FRESH dupe: #2020807: Site functionality problem

mcfilms’s picture

Are there any new versions in need of testing? Is anyone working on this?

At DrupalCampLA I spoke to two new Drupal adopters that mentioned issues with finding the relevant modules on this site. All I could do is blush and suggest that they leave Drupal, go to Google, and search for the module by name and include "Drupal module."

Google: "Drupal Views Module" and the Views module appears first
Drupal site search "Views" or "Views Module" and you do not get the Views Module.

This was not always the case on the D.org Drupal 6 install. Something changed for the worse and it is putting off new adopters.

dddave’s picture

Is this happening due to the upgrade process of d.org to D7? Is this on the list of people working on the d.org upgrade?

drumm’s picture

Yes, we've been concentrating on Drupal.org D7. We are set up for volunteers to work on improving this module, as you can see from the comments on this issue.

dddave’s picture

dddave’s picture

mcfilms’s picture

If this is important to anyone else following this thread, I ask that you visit https://groups.drupal.org/node/313013 and "upvote" (click on the plus sign +) this initiative. There is currently a plan to select a few missing features on Drupal.org and devote some resources to them. (Read more and see other ideas at: https://groups.drupal.org/drupal-org-2014-roadmap-brainstorming.)

drumm’s picture

Issue summary: View changes
Status: Needs work » Closed (cannot reproduce)

I believe this was fixed at some point.