The apachesolr.api.php documentation for addFilter is confusing for newcomers. Any person reading the following example will automatically assume that the filter is referring to the English word "is":

function hook_apachesolr_query_alter($query) {
  // I only want to see articles by the admin!
  $query->addFilter("is_uid", 1);
}

...when in fact it means nothing of the sort :(

It is shorthand for Integer Single (abbreviated "is"), which is, to say the least, unintuitive for someone with no Solr experience. We need to add an explanation of this difference and provide instructions for the user to go inspect schema.xml so developers can properly learn how deep and complex the functionality of addFilter really is.

Comments

rupl’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

Patch!

nick_vh’s picture

Great initiative! Can we have more of these patches? :-)

elliotttf’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Adds clarity and should help developers just starting with solr untangle things.

rupl’s picture

Status: Reviewed & tested by the community » Needs review

Sure thing, I promise to continue adding them as I find issues!

rupl’s picture

Status: Needs review » Reviewed & tested by the community

whooppppss sry

nick_vh’s picture

Status: Reviewed & tested by the community » Fixed

committed to 6.x-3.x and 7.x-1.x. Thanks for the docs!

jhedstrom’s picture

Priority: Normal » Critical
Status: Fixed » Needs review
StatusFileSize
new619 bytes

This commit (bc2d6af3) to 6.x had a dsm() in it.

Status: Needs review » Needs work

The last submitted patch, apachesolr-search-remove-dsm-1811456-07.patch, failed testing.

pwolanin’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Needs work » Needs review
pwolanin’s picture

pwolanin’s picture

Status: Needs review » Fixed

committed, thanks

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Rewording issue summary to reflect the needs of newcomers, maybe will help with people Googling.