On Sep 24, 2008, at 2:09 PM, Mark Miller wrote:
Erik Hatcher wrote:
Solr out of the box, built in example data:
http://localhost:8983/solr/select?q.alt=cat:electronics&defType=dismax&bq=
{!dismax%20qf=name}ipod&fl=*,score&debugQuery=true
Gives me this response:
HTTP ERROR: 400
org.apache.lucene.queryParser.ParseException: Infinite Recursion
detected parsing query 'ipod'
Am I using this incorrectly with the bq parameter {! funkiness?
Or... ??
Erik
Bug maybe? Unless that syntax is not supposed to be supported? The
problem is that it keeps seeing the boosted query, and then it goes,
okay, make a subparser for ipod, and it does, but it still sees the
same boosted query from the params, so it goes, okay another parser
to deal with the subquery ipod, so it makes a new one and calls
parse, but then it still sees the same boosted query from the params
and so makes a subparser to handle the ipod part, and --- ...
Ah, so bq goes down the line, scary. So I tried this:
http://localhost:8983/solr/select?q.alt=cat:electronics&defType=dismax&bq=
{!dismax%20qf=name%20bq=}ipod&fl=*,score&debugQuery=true
except that "ipod" doesn't become a *boosting* query, it becomes a
narrowing clause:
<str name="parsedquery">
+cat:electronics +DisjunctionMaxQuery((name:ipod)) ()
</str>
Why is it that SHOULD is not used when a boosting query is already an
unboosted boolean query?
if (1.0f == f.getBoost() && f instanceof BooleanQuery) {
/* if the default boost was used, and we've got a
BooleanQuery
* extract the subqueries out and use them directly
*/
for (Object c : ((BooleanQuery)f).clauses()) {
query.add((BooleanClause)c); // <-
shouldn't this be SHOULD? or just skip the if altogether and just add
the boolean query as a should clause?
}
} else {
query.add(f, BooleanClause.Occur.SHOULD);
}
Thanks,
Erik