In the d.o redesign, the project browsing pages will use faceted search, but not using the standard facet block UI like we have at http://drupal.org/project/modules. Instead, the redesign calls for a navigation form at the top of the main content area. However, the mockup is wrong in a few important ways, which we've clarified through discussions with Mark Boulton. See http://groups.drupal.org/node/20213 for scanned versions of the edited mockups from previous sprints and DCDC. The details are:

A) Instead of a giant wall of checkboxes for each category (since there are 35 of them (and growing)), there will be a drop-down select for the category to use. This list should be sorted alphabetically (see #376970: Change sort order of module categories to alphabetical?), and should still contain the number of modules that match the current search in each category, just like the existing facet block does.

B) We need a "Order by" selector, which is going to be a drop-down selector. For now, we can just use the same sort criteria that are provided in the existing project_solr block, but we can always add more later as we can support the other options.

C) We still need a search box specifically for project nodes as part of this "Find a Module" form.

D) Probably goes without saying, but we also need a submit button of some kind here. ;) Not exactly sure what its call to action should be, probably just "Search".

The submit handler for this form just has to know enough to generate the appropriate GET query for Solr to do the right thing. Looking at the existing project_solr.module (which is probably 75% code for the existing facet blocks) and/or playing with the existing project browsing pages should give a good sense of what the resulting URL to redirect to needs to be. Ideally we'd define the form in such a way that the form's own GET arguments exactly matched what Solr is expecting and we can make the #action for this form GET instead of POST...

Comments

pwolanin’s picture

I don't see any gotchas here, aside from possible apachesolr API changes of course ;-)

mfb’s picture

Assigned: Unassigned » mfb
Priority: Normal » Critical

This is blocking launch of the new design so setting to critical.

mfb’s picture

Status: Active » Needs review
StatusFileSize
new5.05 KB

Here's what I have so far. There are some UI issues, e.g. when searching for text string, the facet blocks default to searching by relevancy and then you can choose some other sort order. In a form the user would have to manually choose to sort by relevancy. Also, sorting by relevancy without a text string is invalid, and so the submit handler silently ignores this and reverts to sorting by title.

mfb’s picture

StatusFileSize
new6.42 KB

added some js to deal with above-mentioned UI issues.

lisarex’s picture

Linking this from the Redesign project #661692: Meta issue for modules Project and Project issue tracking because this issue was tagged 'drupal.org redesign'

kjay’s picture

This patch applies but no longer works with the current project_solr.module due to the removal of the original project_solr_response_cache() function in the recent API cleanup work http://drupal.org/node/679060.

csevb10’s picture

The following 2 lines should create virtually identical functionality, HOWEVER, as noted in this comment - http://drupal.org/node/679060#comment-2739610 - the execution of the apachesolr module can cause havoc with these commands depending on when they are run.

  $response = apachesolr_static_response_cache();
  $query    = apachesolr_current_query();

Be back at this in a bit.

pwolanin’s picture

Status: Needs review » Needs work

Trying to figure out what the patch is doing - seems a little out to build a query object jsut to get the path

kjay’s picture

StatusFileSize
new6.59 KB

I've made progress on this. I've worked out which methods have been changed/renamed, which includes the two that Bill flagged up. Here is a new patch that gets us going again. At this time, I've hard-coded this to work for modules as I ran out of time (see line 580 of project_solr.module once the patch is applied).

Next up - getting this to work as it should for the various tabs and working out what form elements are needed for each D&E tab - this is now running on http://staging5.drupal.org/project/modules

makara’s picture

Solr_Base_Query->get_path() returns something like "project/modules/xxx" which is the default Solr way of doing search I think. But we are now using like "project/modules?text=xxx". Is there any special purpose?

makara’s picture

StatusFileSize
new3.06 KB

Well if no special purposes, here is the quick fix that can be applied on staging 5 HEAD (for search text and sorting). Please have a look.

makara’s picture

I changed it back to "project/modules?text=xxx" in r2865.

kjay’s picture

Thanks makara.

r2871 on staging5.drupal.org/project/modules now has the form inserted below the term description copy as per the Mark Boulton prototypes. I've also added the 'Find a Module/Theme/etc' title based on parent term less the last character. Plus I've set the form to respond to arg(1) for each tab. This is going to need discussion since it is a drupal.org specific thing but it gets us moving on.

makara’s picture

StatusFileSize
new1.96 KB

kjay:

You could use $parent_term as an argument, like what I attached.

One thing I'm concerned about is http://drupal.org/node/679060. How do we merge things like this?

csevb10’s picture

StatusFileSize
new6.54 KB

This is a consolidated patch of everything from this chain working against the latest project HEAD.
There are still some fixes/improvements to be done, but at least this consolidates all of the important work from before.

csevb10’s picture

Status: Needs work » Needs review
StatusFileSize
new12.76 KB

This is the consolidated patch + a bunch of work to expand the navigation form to handle our project-type vocabularies.
Since expansion to handle project-type-specific vocabularies is in project.module, it seems to make sense to expand project_solr to be able to handle and utilize those elements on the browse form - in my opinion.

This may not be the final version of this - I doubt it is - but it's a working version of the navigation form and should give us a patch to review, discuss and refine.
--Bill

csevb10’s picture

StatusFileSize
new8.24 KB

Streamlined version for single-select (radio) element at present. We might want to consider a "none" option, but at least this version is vastly more straightforward.

csevb10’s picture

StatusFileSize
new8.25 KB

Select just makes more sense than radios, and it has the side benefit of unifying the interface.

csevb10’s picture

StatusFileSize
new8.95 KB

A cleaned up version re-introducing the OR-style faceting.

csevb10’s picture

StatusFileSize
new12.84 KB

There's a sorting issue that I think still needs to get sorted out (ha-ha), but this should contain most (if not all) of the other changes we discussed.

hunmonk’s picture

StatusFileSize
new13.93 KB

fixed some bugs in the new helper function for pulling vocabs related to project terms, removed some array_reverse() and drupal_strtolower() calls that were too d.o specific, cleaned up code comments.

csevb10’s picture

StatusFileSize
new15.05 KB

A fix for text search + re-including the js.

csevb10’s picture

Status: Needs review » Needs work
StatusFileSize
new16.18 KB

Fix for the solr sorting for latest release and recent activity.

csevb10’s picture

StatusFileSize
new1.01 KB
new15.05 KB

We ripped out the js b/c it seems relatively pointless and overly complex for the functionality it's providing. We've replaced it with a simple message if relevancy sort is selected without text. Attached is the "js" file as txt in case we need it in the future.

hunmonk’s picture

Assigned: mfb » Unassigned
Status: Needs work » Active

after further discussion about the sort by labels, made the following changes:
"Usage statistics" is now called "Most installed", "Recent activity" is now called "Last build"

other than that, committed the patch in #24 as is to HEAD.

nice work all!

setting back to active as we do still need some basic theming/CSS on the form to make it look a little nicer.

mikey_p’s picture

mikey_p’s picture

StatusFileSize
new2.52 KB

Here's a patch the floats the button below, I'll try to ping someone tomorrow for help sorting out the IE issue.

csevb10’s picture

Hey Mikey - I don't want to create competing patches, so can you also, when you make that fix, change "submit" and "Submit" to "search" and "Search" at the bottom of project_solr_browse_projects_form? Just something small we missed in the original patch. submit works, but search is more descriptive. If not, I'll roll a patch afterwards.
Thanks.
--Bill

hunmonk’s picture

Status: Needs review » Needs work

committed the patch in #27 to HEAD, and deployed to drupal.org.

however, there are a couple of problems:

  1. the 'Submit' -> 'Search' change mentioned in #28
  2. at http://drupal.org/project/modules, the default sort order when you load the page is by 'Most installed', but the 'Sort by' select list defaults to 'Title', which is a bit confusing. we need to decide which of the two of those is actually the default sorting order, and make them agree on initial page load.
csevb10’s picture

StatusFileSize
new999 bytes

Changed "submit" to "search" for greater clarity.
Pushed the sort to draw from a variable get since that's how the browse page does it (and why the inconsistency was introduced).

csevb10’s picture

StatusFileSize
new877 bytes

key = submit
value = Search

hunmonk’s picture

Status: Needs work » Fixed

committed #39 to HEAD, deployed to drupal.org, merged to redesign.drupal.org bzr branch.

dww’s picture

Status: Fixed » Needs work

If you land on http://drupal.org/project/modules, type in some search text and press "Search", the default order should be relevancy, not "Most installed". I *believe* that used to work as expected, even given #406728: Default sort on Modules / Themes pages. But, it appears that this patch has broken this behavior. I'll try to catch up with csevb10 to figure out which one of us should actually debug and fix this. ;)

That said, great work getting this done!

Cheers,
-Derek

hunmonk’s picture

that probably worked because of the .js file that automagically switched the sort order select box when somebody typed text into the search box. i personally felt that what that functionality was trying to do fell into the "trying to be smart, but mostly being annoying" category, so csevb10 and i decided not to include it. it's conveniently attached to #24 in case there's a compelling reason to change our mind.

hunmonk’s picture

dww’s picture

Before the form, it was just done automatically by the facet blocks. I don't think is is being too smart -- if you do a text-based search, you absolutely are going to expect relevancy to be the default sort order, unless you really go out of your way to change it. This came up in #3 and #4 originally when mfb and I were first working on this.

I'll revisit this when I have a chance, since I just had an idea about how it could work that's not too complicated, but I'll have to think it through to see if it's viable before I bother writing it up or hacking the code.

drumm’s picture

Priority: Critical » Normal