You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2013/02/02 00:43:03 UTC

[Solr Wiki] Update of "FunctionQuery" by JackKrupansky

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "FunctionQuery" page has been changed by JackKrupansky:
http://wiki.apache.org/solr/FunctionQuery?action=diff&rev1=90&rev2=91

  === exists ===
  '''exists(field|function)''' returns true if a value exists for a given document.
  
- Example use: {{{exists(myField)}}} will return if myField has a value, while {{{exists(query(year:2012))}}} will return true for docs with year=2012.
+ Example use: {{{exists(myField)}}} will return true if myField has a value, while {{{exists(query({!v='year:2012'}))}}} will return true for docs with year=2012.
  
  === if ===
  '''if(expression,trueValue,falseValue)''' emits trueValue if the expression is true, else falseValue. An expression can be any function which outputs boolean values, or even functions returning numeric values, in which case value 0 will be interpreted as false, or strings, in which case empty string is interpreted as false.