title: Solr boost query syntax
body: <p>The <a href="https://wiki.apache.org/solr/FunctionQuery#exists" rel="nofollow">Solr function query documentation</a> says:</p>
  
  <p><code>exists(query({!v='year:2012'}))</code> will return <code>true</code> for docs with <code>year</code>=2012</p>
  
  <p>I have a document like:</p>
  
  <pre><code>{
    id: 1,
    user_type: ADMIN,
    like_score: 1
  }
  </code></pre>
  
  <p><code>id</code>, <code>user_type</code> and <code>like_score</code> are all indexed and stored files, with <code>id</code> being int, <code>user_type</code> being string and <code>like_score</code> being int.</p>
  
  <p>I issue a query like this:</p>
  
  <pre><code>q={!boost b=if(true,10,1)}id:1&amp;rows=1&amp;fl=*,score
  </code></pre>
  
  <p>which works. But this query does not work:</p>
  
  <pre><code>q={!boost b=if(exists(query({!v='user_type:ADMIN'})),10,1)}id:1&amp;rows=1&amp;fl=*,score
  </code></pre>
  
  <p>It gives an error like this:</p>
  
  <pre><code>"error":{
    "msg":"org.apache.solr.search.SyntaxError: Cannot parse ')),5,10)}id:1': Encountered \" \")\" \") \"\" at line 1, column 0.\nWas expecting one of:\n    &lt;NOT&gt; ...\n    \"+\" ...\n    \"-\" ...\n    &lt;BAREOPER&gt; ...\n    \"(\" ...\n    \"*\" ...\n    &lt;QUOTED&gt; ...\n    &lt;TERM&gt; ...\n    &lt;PREFIXTERM&gt; ...\n    &lt;WILDTERM&gt; ...\n    &lt;REGEXPTERM&gt; ...\n    \"[\" ...\n    \"{\" ...\n    &lt;LPARAMS&gt; ...\n    &lt;NUMBER&gt; ...\n    &lt;TERM&gt; ...\n    \"*\" ...\n    ",
    "code":400
  }
  </code></pre>
  
  <p>How do I fix the query?</p>
  
  <p>This syntax works:</p>
  
  <pre><code>q={!func}if(exists(query({!v='user_type:ADMIN'})),5,10)&amp;rows=1&amp;fl=*,score
  </code></pre>
  
  <p>but it doesn't do what I want to the score.</p>