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 Mihail Radkov <mi...@sirma.bg> on 2017/11/17 13:46:16 UTC
Solr 6.6.0 - Query does not implement createWeight
Hello everybody!
I've migrated from Solr 6.5.0 to Solr 6.6.0 but it introduced a problem with
wildcards in join edismax queries.
My documents looks similar to this:
{
"id": "1",
"title": "testing",
"hasAttachment": ["2"]
}
{
"id": "2",
"title": "an attachment"
}
So to query all documents that match test* but also match any which are
attachments to those documents but with lower score, I use the following
query parameters:
{
"q":"({!join score=max from=id to=hasAttachment }{!edismax v=$uq
qf=title} OR {!edismax v=$uq})",
"defType":"edismax",
"indent":"on",
"qf":"title^10",
"fl":"id,score",
"uq":"test*", // uq is custom parameter for terms entered by users
used as variable in q
"wt":"json"
}
However in Solr 6.6.0 the wildcard in test* is causing Solr to throw an
exception:
java.lang.UnsupportedOperationException: Query title:test* does not
implement createWeight
If I remove score=max, Solr returns results but it's not ranking the
attachments
I managed to reproduce the problem with one of the shipped test data in
Solr:
1) Download Solr 6.6.0
2) Start it with the provided test data techproducts
./bin/solr start -e=techproducts
3) Executing the next join query returns the expected results
http://localhost:8983/solr/techproducts/select?defType=edismax&indent=on&q=({!join%20from=manu_id_s%20to=id%20score=max}{!edismax%20v=$uq%20qf=name}%20OR%20{!edismax%20v=$uq})&qf=name^2&uq=canon&wt=json
4) However if I change uq to include a wildcard, e.g. uq=cano*
http://localhost:8983/solr/techproducts/select?defType=edismax&indent=on&q=({!join%20from=manu_id_s%20to=id%20score=max}{!edismax%20v=$uq%20qf=name}%20OR%20{!edismax%20v=$uq})&qf=name^2&uq=cano*&wt=json
this results in the following exception:
java.lang.UnsupportedOperationException: Query name:cano* does not implement
createWeight
at org.apache.lucene.search.Query.createWeight(Query.java:66)
at
org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:751)
at
org.apache.lucene.search.DisjunctionMaxQuery$DisjunctionMaxWeight.<init>(DisjunctionMaxQuery.java:106)
at
org.apache.lucene.search.DisjunctionMaxQuery.createWeight(DisjunctionMaxQuery.java:190)
at
org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:751)
at org.apache.lucene.search.BooleanWeight.<init>(BooleanWeight.java:60)
at
org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:225)
at
org.apache.lucene.search.join.TermsIncludingScoreQuery.createWeight(TermsIncludingScoreQuery.java:100)
at
org.apache.solr.search.join.ScoreJoinQParserPlugin$SameCoreJoinQuery.createWeight(ScoreJoinQParserPlugin.java:171)
at
org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:751)
at org.apache.lucene.search.BooleanWeight.<init>(BooleanWeight.java:60)
at
org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:225)
at
org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:751)
at
org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:734)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472)
at
org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:217)
at
org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1582)
at
org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1399)
at
org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:566)
at
org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:545)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:296)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at
org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:534)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at
org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:745)
I've also tested this with Solr 7.0.0 where it's not reproducible but I
cannot currently migrate to that version.
Any thoughts and/or suggestions are welcome.
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html