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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | apachesolr-search-remove-dsm-1811456-07.patch | 619 bytes | jhedstrom |
| #1 | 1811456-1-addfilter-docs.patch | 1.03 KB | rupl |
Comments
Comment #1
ruplPatch!
Comment #2
nick_vhGreat initiative! Can we have more of these patches? :-)
Comment #3
elliotttf commentedLooks good to me. Adds clarity and should help developers just starting with solr untangle things.
Comment #4
ruplSure thing, I promise to continue adding them as I find issues!
Comment #5
ruplwhooppppss sry
Comment #6
nick_vhcommitted to 6.x-3.x and 7.x-1.x. Thanks for the docs!
Comment #7
jhedstromThis commit (bc2d6af3) to 6.x had a dsm() in it.
Comment #9
pwolanin commentedComment #10
pwolanin commented#7: apachesolr-search-remove-dsm-1811456-07.patch queued for re-testing.
Comment #11
pwolanin commentedcommitted, thanks
Comment #12.0
(not verified) commentedRewording issue summary to reflect the needs of newcomers, maybe will help with people Googling.