You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Anca Kopetz <an...@kelkoo.com> on 2014/01/06 18:29:17 UTC
Re: How to boost documents ?
Hi,
I tried to isolate the problem, so I tested the following query on solr-4.6.0 :
http://localhost:8983/solr/collection1/select?q=ipod belkin&wt=xml&debugQuery=true&q.op=AND&defType=edismax&bf=map(query($qq),0,0,0,100.0)&qq={!edismax}power
The error is :
org.apache.solr.search.SyntaxError: Infinite Recursion detected parsing query 'power'
And the stacktrace :
ERROR - 2014-01-06 18:27:02.275; org.apache.solr.common.SolrException; org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError: Infinite Recursion detected parsing query 'power'
at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:171)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1859)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:710)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:413)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:197)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:368)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.solr.search.SyntaxError: Infinite Recursion detected parsing query 'power'
at org.apache.solr.search.QParser.checkRecurse(QParser.java:178)
at org.apache.solr.search.QParser.subQuery(QParser.java:200)
at org.apache.solr.search.ExtendedDismaxQParser.getBoostFunctions(ExtendedDismaxQParser.java:437)
at org.apache.solr.search.ExtendedDismaxQParser.parse(ExtendedDismaxQParser.java:175)
at org.apache.solr.search.QParser.getQuery(QParser.java:142)
at org.apache.solr.search.FunctionQParser.parseNestedQuery(FunctionQParser.java:236)
at org.apache.solr.search.ValueSourceParser$19.parse(ValueSourceParser.java:270)
at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:352)
at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:223)
at org.apache.solr.search.ValueSourceParser$13.parse(ValueSourceParser.java:198)
at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:352)
at org.apache.solr.search.FunctionQParser.parse(FunctionQParser.java:68)
at org.apache.solr.search.QParser.getQuery(QParser.java:142)
at org.apache.solr.search.ExtendedDismaxQParser.getBoostFunctions(ExtendedDismaxQParser.java:437)
at org.apache.solr.search.ExtendedDismaxQParser.parse(ExtendedDismaxQParser.java:175)
at org.apache.solr.search.QParser.getQuery(QParser.java:142)
at org.apache.solr.search.FunctionQParser.parseNestedQuery(FunctionQParser.java:236)
at org.apache.solr.search.ValueSourceParser$19.parse(ValueSourceParser.java:270)
at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:352)
at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:223)
at org.apache.solr.search.ValueSourceParser$13.parse(ValueSourceParser.java:198)
at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:352)
at org.apache.solr.search.FunctionQParser.parse(FunctionQParser.java:68)
at org.apache.solr.search.QParser.getQuery(QParser.java:142)
at org.apache.solr.search.ExtendedDismaxQParser.getBoostFunctions(ExtendedDismaxQParser.java:437)
at org.apache.solr.search.ExtendedDismaxQParser.parse(ExtendedDismaxQParser.java:175)
at org.apache.solr.search.QParser.getQuery(QParser.java:142)
...
Is this a bug ?
Thank you,
Anca
On 12/30/2013 02:30 PM, Anca Kopetz wrote:
Hi,
Thank you for your response.
When I try the URL you sent me, I get the following error message :
org.apache.solr.search.SyntaxError: Infinite Recursion detected parsing query 'beautiful Christmas tree'
Any idea what this means ?
Best regards,
Anca
On 12/16/2013 02:00 PM, Ahmet Arslan wrote:
Hi Anca,
Can you try following URL?
q=beautiful Christmas tree&mm=2&qf=title^12 description^2&defType=dismax&bf=map(query($qq),0,0,0,100.0)&qq={!dismax qf='title description' mm=100%}beautiful Christmas tree
Modified from Jan's solution. See his original post [1] to a similar discussion.
[1] http://search-lucene.com/m/nK6t9j1fuc2
On Monday, December 16, 2013 12:19 PM, Anca Kopetz <an...@kelkoo.com> wrote:
Hi,
How to boost documents that contain all search terms in several of its fields ?
Below you cand find a simplified example :
The query with Min should match:
q=beautiful Christmas tree&mm=2&qf=title^12 description^2
There are two offers that match the query :
offer1 {title:"Christmas tree", description:"a joy for children"}
offer2 {title:"Christmas tree", description:"beautiful for holidays"}}
The first offer ranks before the second, despite of the fact that the second one contains all the search terms. I tried to play with the boosts of qf, but the results vary a lot.
Is there a way to add a boost on all search fields, the same way we do with pf on one field : pf=title:2^3.0 ?
Thank you,
Anca
________________________________
Kelkoo SAS
Société par Actions Simplifiée
Au capital de € 4.168.964,30
Siège social : 8, rue du Sentier 75002 Paris
425 093 069 RCS Paris
Ce message et les pièces jointes sont confidentiels et établis à l'attention exclusive de leurs destinataires. Si vous n'êtes pas le destinataire de ce message, merci de le détruire et d'en avertir l'expéditeur.
________________________________
Kelkoo SAS
Société par Actions Simplifiée
Au capital de € 4.168.964,30
Siège social : 8, rue du Sentier 75002 Paris
425 093 069 RCS Paris
Ce message et les pièces jointes sont confidentiels et établis à l'attention exclusive de leurs destinataires. Si vous n'êtes pas le destinataire de ce message, merci de le détruire et d'en avertir l'expéditeur.
Re: How to boost documents ?
Posted by Anca Kopetz <an...@kelkoo.com>.
Hi,
I tested the BoostQueryParser and it works on the simplified example.
But we need to keep the edismax Query parser, so I tried the following query and it seems to work (I defined a local bf='' for qq).
&q=beautiful Christmas tree
&mm=2
&qf=title^12 description^2
&defType=edismax
&bf=map(query($qq),0,0,0,100.0)
&qq={!edismax bf='' mm=100%}beautiful Christmas tree
Best regards,
Anca
On 01/07/2014 07:42 PM, Ahmet Arslan wrote:
Hi Hoss,
Thanks for the explanation. Very complicated stuff. I never understand NestedQParserPlugin.
We want all the documents with all terms (mm=100%) get an extra 1000 points, but change nothing else. How would you restructure the following query?
q=beautiful Christmas tree&mm=2&qf=title^12 description^2&defType=dismax&bf=map(query($qq),0,0,0,100.0)&qq={!dismax qf='title description' mm=100%}beautiful Christmas tree
Ahmet
On Tuesday, January 7, 2014 8:12 PM, Chris Hostetter <ho...@fucit.org> wrote:
: http://localhost:8983/solr/collection1/select?q=ipod
: belkin&wt=xml&debugQuery=true&q.op=AND&defType=edismax&bf=map(query($qq),0,0,0,100.0)&qq={!edismax}power
:
: The error is :
: org.apache.solr.search.SyntaxError: Infinite Recursion detected parsing query
: 'power'
:
: And the stacktrace :
:
: ERROR - 2014-01-06 18:27:02.275; org.apache.solr.common.SolrException;
: org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError:
: Infinite Recursion detected parsing query 'power'
your "qq" param uses the edismax parser which goes looking for a "bf" -
since there is no local bf param, it finds the global one -- which
recursively refers to the "qq" param again. Hence the infinite recursion.
You either need to override the bf param locally in your qq param, or
restructure your query slightly so the bf is not global
Perhaps something like this...
qq=ipod belkin
q={!query defType=edismax bf=$boostFunc v=$qq}
boostFunc=map(query($boostQuery),0,0,0,100.0)
boostQuery={!edismax}power
having said that however: instead of using "bf" you should probably
consider using the "boost" parser -- it's a multiplicitive boost instead
of an additive boost, and (in my opinion) makes the flow/params easier to
understand...
https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-BoostQueryParser
qq=ipod belkin
q={!boost defType=edismax b=$boostFunc v=$qq}
boostFunc=map(query($boostQuery),0,0,0,100.0)
boostQuery={!edismax}power
-Hoss
http://www.lucidworks.com/
________________________________
Kelkoo SAS
Société par Actions Simplifiée
Au capital de € 4.168.964,30
Siège social : 8, rue du Sentier 75002 Paris
425 093 069 RCS Paris
Ce message et les pièces jointes sont confidentiels et établis à l'attention exclusive de leurs destinataires. Si vous n'êtes pas le destinataire de ce message, merci de le détruire et d'en avertir l'expéditeur.
Re: How to boost documents ?
Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Hoss,
Thanks for the explanation. Very complicated stuff. I never understand NestedQParserPlugin.
We want all the documents with all terms (mm=100%) get an extra 1000 points, but change nothing else. How would you restructure the following query?
q=beautiful Christmas tree&mm=2&qf=title^12 description^2&defType=dismax&bf=map(query($qq),0,0,0,100.0)&qq={!dismax qf='title description' mm=100%}beautiful Christmas tree
Ahmet
On Tuesday, January 7, 2014 8:12 PM, Chris Hostetter <ho...@fucit.org> wrote:
: http://localhost:8983/solr/collection1/select?q=ipod
: belkin&wt=xml&debugQuery=true&q.op=AND&defType=edismax&bf=map(query($qq),0,0,0,100.0)&qq={!edismax}power
:
: The error is :
: org.apache.solr.search.SyntaxError: Infinite Recursion detected parsing query
: 'power'
:
: And the stacktrace :
:
: ERROR - 2014-01-06 18:27:02.275; org.apache.solr.common.SolrException;
: org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError:
: Infinite Recursion detected parsing query 'power'
your "qq" param uses the edismax parser which goes looking for a "bf" -
since there is no local bf param, it finds the global one -- which
recursively refers to the "qq" param again. Hence the infinite recursion.
You either need to override the bf param locally in your qq param, or
restructure your query slightly so the bf is not global
Perhaps something like this...
qq=ipod belkin
q={!query defType=edismax bf=$boostFunc v=$qq}
boostFunc=map(query($boostQuery),0,0,0,100.0)
boostQuery={!edismax}power
having said that however: instead of using "bf" you should probably
consider using the "boost" parser -- it's a multiplicitive boost instead
of an additive boost, and (in my opinion) makes the flow/params easier to
understand...
https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-BoostQueryParser
qq=ipod belkin
q={!boost defType=edismax b=$boostFunc v=$qq}
boostFunc=map(query($boostQuery),0,0,0,100.0)
boostQuery={!edismax}power
-Hoss
http://www.lucidworks.com/
Re: How to boost documents ?
Posted by Chris Hostetter <ho...@fucit.org>.
: http://localhost:8983/solr/collection1/select?q=ipod
: belkin&wt=xml&debugQuery=true&q.op=AND&defType=edismax&bf=map(query($qq),0,0,0,100.0)&qq={!edismax}power
:
: The error is :
: org.apache.solr.search.SyntaxError: Infinite Recursion detected parsing query
: 'power'
:
: And the stacktrace :
:
: ERROR - 2014-01-06 18:27:02.275; org.apache.solr.common.SolrException;
: org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError:
: Infinite Recursion detected parsing query 'power'
your "qq" param uses the edismax parser which goes looking for a "bf" -
since there is no local bf param, it finds the global one -- which
recursively refers to the "qq" param again. Hence the infinite recursion.
You either need to override the bf param locally in your qq param, or
restructure your query slightly so the bf is not global
Perhaps something like this...
qq=ipod belkin
q={!query defType=edismax bf=$boostFunc v=$qq}
boostFunc=map(query($boostQuery),0,0,0,100.0)
boostQuery={!edismax}power
having said that however: instead of using "bf" you should probably
consider using the "boost" parser -- it's a multiplicitive boost instead
of an additive boost, and (in my opinion) makes the flow/params easier to
understand...
https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-BoostQueryParser
qq=ipod belkin
q={!boost defType=edismax b=$boostFunc v=$qq}
boostFunc=map(query($boostQuery),0,0,0,100.0)
boostQuery={!edismax}power
-Hoss
http://www.lucidworks.com/