ApacheSolr is a module for Drupal 6, to improve the search experience of both ApacheSolr Search Integration. ApacheSolr search integration currently indexes and creates facets for taxonomy fields, but not for CCK numeric fields. Facets for these fields have been requested by users of both ApacheSolr Search Integration and ApacheSolr Views:

#728088: Add support for CCK Decimal fields and Numeric Facets
#1202086: Remove duplicate filters from enabled filters list defined by other modules

This module allows users to index numeric and computed CCK fields with Apache Solr Search, then create exposed facets for those fields. The UI allows users to choose which numeric/computed fields will be exposed with Apache Solr Search (note: you will need to rebuild the index) and create exposed filters for numeric fields, with front end control over range limits and facet text (see README.txt). This module is also compatible with Apache Solr Views.

Please note that much of this code was suggested/improved by user rjbrown99. We had each developed similar modules for our own use cases, and he knows that I am working on this more general use module.

Project page: http://drupal.org/sandbox/brycesenz/1258510
Git Repository: brycesenz@git.drupal.org:sandbox/brycesenz/1258510.git

I have run this module through Coder, and believe that my coding standards create no minor/major/critical warnings.

For an example of the numeric filters created with this module, see my site TrailLove

Comments

rjbrown99’s picture

For what it's worth, consider me a +1 on including this as a new module. I have some plans to contribute to this and potentially use it as well.

brycesenz’s picture

Priority: Normal » Major

Changing the priority to 'major', per submission timeline guidelines.

To potential reviewers, here is an outline of what needs to be reviewed based on the standard review criteria:

Similar modules: The only similar module is Apache Solr Facet Builder. However, this module still does not have a stable release, nor does it function in conjunction with ApacheSolr Views, as my module does.

Third Party Files: None, so this should not be a concern.

Security This is where I feel it would be most beneficial to have a fresh set of eyes check that the code is secure.

Best Coding Practices & Standards: My code uses appropriate drupal hooks and passes all Coder module tests.

Please let me know if there are any questions or concerns standing in the way of this module's approval.

brycesenz’s picture

Priority: Major » Critical

Changing the priority to 'critical', per submission guidelines.

klausi’s picture

Priority: Critical » Normal
Status: Needs review » Needs work
  • broken line endings in README.txt ('\r'). Use unix line endings ('\n')
  • same for the info file
  • lines in README.txt should not exceed 80 characters.
  • Remove all old CVS $Id tags from all files, not needed anymore.
  • apachesolr_numeric_facets_block(): why are there 2 "break;" statements at the end of the view case? The last one should be enough.
  • "//loop through our results once to find out the min and max price": comments should start capitalised and end with a ".". There should be a space after "//".
  • apachesolr_numeric_facets_admin_settings(): don't add $form['no-facets-message'] at all if there are field instances available. Use an if statement instead of the #access work around.
brycesenz’s picture

Status: Needs work » Needs review

Modifications from #4 have been made.

natemow’s picture

Status: Needs review » Needs work

Review of the 6.x-1.x branch:

  • Lines in README.txt should not exceed 80 characters, see the guidelines for in-project doc umentation.
  • Comments: there should be a space after "//", see http://drupal.org/node/1354#inline
    apachesolr_numeric_facets.install:19:  //Remove modules variables
    apachesolr_numeric_facets.module:207:    //parse the division input from our block textarea field
    apachesolr_numeric_facets.module:215:      //if the range is -inf, use the $neg_inf variable defined above
    apachesolr_numeric_facets.module:222:      //if the range is inf, use the $pos_inf variable defined above
    apachesolr_numeric_facets.module:259:      //The sorting logic is determined by the checkbox in the block configuration
    apachesolr_numeric_facets.module:272:      //Set the display text.
    apachesolr_numeric_facets.module:296:        //Pass all of the count, text, etc. information back through the $link variable
    
  • ./apachesolr_numeric_facets.module: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
          //The sorting logic is determined by the checkbox in the block configuration
            //Pass all of the count, text, etc. information back through the $link variable
    
  • Bad line endings were found, always use unix style terminators. See http://drupal.org/coding-standards#indenting
    ./apachesolr_numeric_facets.info:      ASCII text, with CRLF line terminators
    apachesolr_numeric_facets.info
    apachesolr_numeric_facets.install
    
  • All text files should end in a single newline (\n). See http://drupal.org/node/318#indenting
    ./apachesolr_numeric_facets.module ./apachesolr_numeric_facets.install ./README.txt ./apachesolr_numeric_facets.admin.inc ./apachesolr                                                                          _numeric_facets.info
    

This automated report was generated with PAReview.sh, your friendly project application revie w script. Go and review some other project applications, so we can get back to yours sooner.

brycesenz’s picture

Status: Needs work » Needs review

I believe that those issues have all been addressed in the release I posted today.

These line ending issues are killing me - I've been using the "dos2unix" function after I upload changes from my local workstation; Is there a simpler way?

doitDave’s picture

Status: Needs review » Needs work
StatusFileSize
new4 KB

Hi!

I have attached the latest review script results for you. Then, some additions:

Git
There are already tags in your repo. You will really not need them before you have turned it into a full project and start releasing. Also there are still files in your master branch. I recommend you take some time with http://drupal.org/node/1014932, especially http://drupal.org/node/1127732 (step 5).

(I was just about opening you demo site for a better understanding of your modules intent, but it was actually not reachable - don't know why. Blank page.)

brycesenz’s picture

I believe that the latest commits fix all of those lingering issues.

Sorry about the site being down; I've had some server issues, which sadly are still lingering. It should be up and running now, albeit not super quick (http://www.traillove.com/browse).

The numeric facets to the side of that page are what this module handles.

natemow’s picture

Status: Needs work » Needs review

Manual review:

  • apachesolr_numeric_facets.module -- Bad line endings were found, always use unix style terminators. See http://drupal.org/coding-standards#indenting
  • apachesolr_numeric_facets.admin.inc -- ln 25, inconsistent indentation; +2 on '#default_value'
  • apachesolr_numeric_facets_menu -- 1 space between key/val pairs; see http://drupal.org/node/318#array
  • apachesolr_numeric_facets_block -- add a break; before each case.
  • apachesolr_numeric_facets_block -- case 'configure', indent 2 spaces on $form['apachesolr_numeric_facets_sort_by_hits']
natemow’s picture

Status: Needs review » Needs work
rjbrown99’s picture

Guys, come on. We are holding up a legitimate project application for 4 months over what is now a few spaces and line endings. I'm all for code review, both manual and automated, but we're not talking about security issues with the code at this point.

Can we please just approve his application for a git account and promote it to a project to allow for more collaborators to assist? I have been personally contacted by a number of developers looking for this very module (since I created a similar custom version of this) and I fear we're all starting to fork off similar modules and duplicate work.

I have my git account, if you want I'll create it and you can add brycesenz as a co-maintainer - whatever. I just want it up so people can start using it and contributing bugfixes, enhancements, etc. Thank you.

natemow’s picture

Status: Needs work » Needs review

I'm probably not the best person to handle security review or deeper testing with Solr (not having worked with it before). Just trying to help out with the low-level checks here...is there a more experienced reviewer out there that could help out?

klausi’s picture

Status: Needs review » Needs work
StatusFileSize
new2.52 KB

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 6.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

manual review:

  • apachesolr_numeric_facets_menu(): 'access argument' is missing.
  • 'Use this screen to select which numeric/computed fields should be handled using Apache Solr Custom Fields': does not match the current module name?

I know, getting feedback on your application took long, you can speed up the process with #1410826: [META] Review bonus.

brycesenz’s picture

Ok, I have made the changes as per comment #14. The latest code can be found in the 6.x-1.x branch, and the master branch has been cleaned out.

Please let me know if there is anything else I need to change.

brycesenz’s picture

Status: Needs work » Needs review

Oops, and setting to 'needs review.'

brycesenz’s picture

Priority: Normal » Major

Setting review priority to major, per application guidelines: http://drupal.org/node/539608

brycesenz’s picture

Priority: Major » Critical

Setting review priority to critical, per application guidelines.

efes’s picture

Priority: Critical » Normal
Status: Needs review » Needs work
StatusFileSize
new1.71 KB

Good module, good work!

Please, correct some minor issues about following coding guidelines . I attached the automated report.

I know, it could be a tedious and meaningless work at first glance, but these modifications will provide an absolute consistent look and feel of your code to everybody. See: http://drupal.org/coding-standards

If these changes will be done, I could not see any other problem.

patrickd’s picture

Status: Needs work » Needs review

Don't switch to needs work if there are only some minor/few issues thrown by automated tools

rjbrown99’s picture

It has been 8 months of back-and-forth over minor coding issues. Can we please please just approve the application so Bryce can contribute this back to the community?

I have an existing d.org git account - would you all feel more comfortable about this if I just promoted it to a project and changed the application request to add bryce as a co-maintainer?

klausi’s picture

Please see the project application workflow: http://drupal.org/node/532400
Only applications that are in the "reviewed & tested by the community" state will get approved. Please review and test the module, then set it to RTBC if you think it is ready.

Sorry for the delay, but there are no reviews of other project applications listed in the issue summary as strongly recommended in the application documentation.

rjbrown99’s picture

Status: Needs review » Reviewed & tested by the community

OK, will do then. I have tested with the module posted in the sandbox and also have my own that is ~95% similar to it. I'd like to potentially combine the two approaches after this is promoted as a project.

brycesenz’s picture

@klausi -

My frustration with the process has been twofold -

First, my code is expected to meet changing standards. For example, it was previously not necessary to have the third line contain a description. It became a standard in between when the code was submitted and when it was reviewed. How can I be expected to hit that sort of moving target?

Second, I get that my review process is slow because I did not review other projects. But reviewing other projects is an optional bonus, not a requirement, and I have followed that path of the process to the letter. In that respect, the process honestly seems broken - it took seemingly six months before anyone even looked to verify that the code did what it said it did instead of just telling me of the latest spacing errors.

I'm sorry to vent, and that's all it's meant to be. But if this is how it's going to feel for everyone new who wants to contribute to the community, then I fear we'll discourage a lot of newcomers.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

@brycesenz: the coding standards are not changing that much, but the automated review tools are getting better and better at detecting coding standard errors.

Sorry that the process feels a bit painful for you. Don't get me wrong - I don't want to discourage contributions, but we also need to do some basic quality assurance on drupal.org. Projects should be secure, they should not violate any licenses, they should not duplicate existing modules. And of course we don't want spammers to squat our project name space.

So while there is more automation planned for the review process we need to help each other right now to keep it going.

Now a review:

  1. There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
  2. The errors detected by automated tools listed in #19 are still not fixed.
  3. "'info' => t($info),": do not pass dynamic variables to t() where possible because then the string cannot be detected by translation extraction tools. Also elsewhere.
  4. apachesolr_numeric_facets_admin_settings(): doc block is wrong, this is not a hook. See http://drupal.org/node/1354#forms

You should definitively fix those issues, but they are no blockers.

Thanks for your contribution, brycesenz! Welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.