: When I use your url example : http://localhost:8983/solr/select?q=*:*&rows=100&fl=id,inStock,if%28inStock,10,0%29&debugQuery=true : I have : : <long name="if(inStock,10,0)">10</long> : (and my document does not have the inStock field)
Elodie, this is definitely a tricy one... I can reproduce the problme you are describing, on 4.3, 4.4, and trunk -- but aparently it only happens when there are no other docs in the segment that have a value for that field??? i've filled a bug for this... https://issues.apache.org/jira/browse/SOLR-5231 ...but i have no idea what's going on. the work arround seems to be to use the exists() function explicitly in your if() condition. -Hoss