[
https://issues.apache.org/jira/browse/SOLR-4479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14309522#comment-14309522
]
Timothy Potter commented on SOLR-4479:
--------------------------------------
Adding the shards.qt to the query params avoids this NPE, i.e. the following
query works for me on 4.10 branch:
{code}
bin/solr -e cloud -noprompt
java -Durl=http://localhost:8983/solr/gettingstarted/update -jar
example/exampledocs/post.jar example/exampledocs/*.xml
curl
"http://localhost:8983/solr/gettingstarted_shard1_replica1/tvrh?q=*%3A*&wt=json&indent=true&tv.fl=name&rows=50&shards.qt=/tvrh&shards.info=true"
{code}
So the easiest solution here would be to update the {{/tvrh}} requestHandler
definition in solrconfig.xml to be:
{code}
<requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">text</str>
<bool name="tv">true</bool>
<str name="shards.qt">/tvrh</str>
</lst>
<arr name="last-components">
<str>tvComponent</str>
</arr>
</requestHandler>
{code}
But this has me thinking about whether there's a bigger bug at play here?
Specifically, if Solr is in distributed mode, then the {{shards.qt}} parameter
should default to the same path as the top-level request handler ({{/tvrh}} in
this example). I tried the same with the {{/spell}} request handler and same
result, the underlying distributed shard requests all went to {{/select}} and
since the SpellChecking component is not wired into /select by default, there's
really no spell checking happening on each shard.
In other words, if you send a distributed query to {{/tvrh}} without the
{{shards.qt}} parameter, then the underlying shard requests are sent to
{{/select}} and not {{/tvrh}} on each replica. The work-around is simple but
seems like the default behavior should be to work without shards.qt???
> TermVectorComponent NPE when running Solr Cloud
> -----------------------------------------------
>
> Key: SOLR-4479
> URL: https://issues.apache.org/jira/browse/SOLR-4479
> Project: Solr
> Issue Type: Bug
> Affects Versions: 4.1
> Reporter: Vitali Kviatkouski
> Assignee: Timothy Potter
>
> When running Solr Cloud (just simply 2 shards - as described in wiki), got NPE
> java.lang.NullPointerException
> at
> org.apache.solr.handler.component.TermVectorComponent.finishStage(TermVectorComponent.java:437)
> at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:317)
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
> at
> org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:242)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:1816)
> at
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:448)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:269)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
> ..... Skipped
> To reproduce, follow the guide in wiki
> (http://wiki.apache.org/solr/SolrCloud), add some documents and then request
> http://localhost:8983/solr/collection1/tvrh?q=*%3A*
> If I include term search vector component in search handler, I get (on second
> shard):
> SEVERE: null:java.lang.NullPointerException
> at
> org.apache.solr.handler.component.TermVectorComponent.process(TermVectorComponent.java:321)
> at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:206)
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:1699)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]