You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "David Smiley (Jira)" <ji...@apache.org> on 2021/03/14 16:50:00 UTC

[jira] [Resolved] (SOLR-13738) UnifiedHighlighter can't highlight GraphQuery

     [ https://issues.apache.org/jira/browse/SOLR-13738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley resolved SOLR-13738.
---------------------------------
    Resolution: Won't Fix

I'm closing this as "Won't Fix".  There are two workarounds:
* Separate this part of your query to a filter query.  If you can't do that because it's complicated, then compose an "hl.q" that doesn't have it.
* Use {{hl.weightMatches=false}}.  The model of the query is not as strong but it's probably fine.

It seems impossible for the weight matches mode of the UH to work with a GraphQuery.  GraphQuery insists on a SolrIndexSearcher because it wants to use DocSets.  It would be an easy modification to expose SIS to the pertinent part of the code but that part of the code wants one specific leafReader, not the top level view that a SolrIndexSearcher is.  Furthermore that leafReader may be synthetic (a MemoryIndex) vs the real thing (a segment reader).  Even all that... a GraphQuery is expensive and it'd be a shame to re-do all that work which brings me back to thinking it doesn't make sense for a GraphQuery to be in a highlighted query in the first place.

> UnifiedHighlighter can't highlight GraphQuery
> ---------------------------------------------
>
>                 Key: SOLR-13738
>                 URL: https://issues.apache.org/jira/browse/SOLR-13738
>             Project: Solr
>          Issue Type: Bug
>          Components: highlighter
>    Affects Versions: 8.2
>            Reporter: Jochen Barth
>            Priority: Major
>
> Mikhail Khludnev said, this is a bug;
> Here the complete error message for the Query below:
> Just tested wirth 8.1.1: works.
> {quote}
> 2019-08-30 12:40:40.476 ERROR (qtp2116511124-65) [   x:Suchindex] o.a.s.h.RequestHandlerBase java.lang.ClassCastException: class org.apache.lucene.search.IndexSearcher cannot be cast to class org.apache.solr.search.SolrIndexSearcher (or
> g.apache.lucene.search.IndexSearcher and org.apache.solr.search.SolrIndexSearcher are in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @5ed190be)
>         at org.apache.solr.search.join.GraphQuery.createWeight(GraphQuery.java:115)
>         at org.apache.lucene.search.uhighlight.FieldOffsetStrategy.createOffsetsEnumsWeightMatcher(FieldOffsetStrategy.java:137)
>         at org.apache.lucene.search.uhighlight.FieldOffsetStrategy.createOffsetsEnumFromReader(FieldOffsetStrategy.java:74)
>         at org.apache.lucene.search.uhighlight.MemoryIndexOffsetStrategy.getOffsetsEnum(MemoryIndexOffsetStrategy.java:110)
>         at org.apache.lucene.search.uhighlight.FieldHighlighter.highlightFieldForDoc(FieldHighlighter.java:76)
>         at org.apache.lucene.search.uhighlight.UnifiedHighlighter.highlightFieldsAsObjects(UnifiedHighlighter.java:641)
>         at org.apache.lucene.search.uhighlight.UnifiedHighlighter.highlightFields(UnifiedHighlighter.java:510)
>         at org.apache.solr.highlight.UnifiedSolrHighlighter.doHighlighting(UnifiedSolrHighlighter.java:149)
>         at org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:171)
>         at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:305)
>         at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:199)
>         at org.apache.solr.core.SolrCore.execute(SolrCore.java:2578)
>         at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:780)
>         at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:566)
>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:423)
>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:350)
>         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
>         at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
>         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
>         at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
>         at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1711)
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
>         at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1347)
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
>         at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
>         at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1678)
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
>         at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1249)
>         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
>         at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
>         at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
>         at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
>         at org.eclipse.jetty.server.Server.handle(Server.java:505)
>         at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
>         at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
>         at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
>         at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
>         at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
>         at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
>         at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
>         at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
>         at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
>         at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:781)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:917)
>         at java.base/java.lang.Thread.run(Thread.java:834)
> {quote}
> Here the Query raising this error:
> {quote}
> start=0&rows=50&sort=sort_title_s%20asc&fl=id&facet=true&facet.mincount=1&facet.field=type_s&facet.field=meta_name_ss&facet.field=meta_periodical_title_s&facet.field=meta_subject_ss&facet.range=meta_date_dtrs&f.meta_date_
> dtrs.facet.range.start=0000-01-01T00%3A00%3A00Z&f.meta_date_dtrs.facet.range.end=2100-01-01T00%3A00%3A00Z&f.meta_date_dtrs.facet.range.gap=%2B1YEAR&json={"query":{"bool":{"must":[{"bool":{"must":["sort_shelflocator_s:cod\
> \ pal\\ lat\\ 00*"],"should":[{"graph":{"from":"parent_ids","query":"parent_ids:\"/digi.ub.uni-heidelberg.de/collection/sammlung51\"","to":"id"}},{"graph":{"from":"parent_ids","query":"parent_ids:\"/digi.ub.uni-heidelberg
> .de/collection/sammlung52\"","to":"id"}}]}},"class_s:meta"],"must_not":[{"join":{"from":"id","query":{"bool":{"must":[{"bool":{"must":["sort_shelflocator_s:cod\\ pal\\ lat\\ 00*"],"should":[{"graph":{"from":"parent_ids","
> query":"parent_ids:\"/digi.ub.uni-heidelberg.de/collection/sammlung51\"","to":"id"}},{"graph":{"from":"parent_ids","query":"parent_ids:\"/digi.ub.uni-heidelberg.de/collection/sammlung52\"","to":"id"}}]}},"class_s:meta"]}}
> ,"to":"parent_ids"}}]}}}
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)