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