kiran created SOLR-10490:
----------------------------

             Summary: SolrStream should not set hashq filter if numWorkers=0 or 
if streamContext is not set
                 Key: SOLR-10490
                 URL: https://issues.apache.org/jira/browse/SOLR-10490
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
    Affects Versions: 6.5
            Reporter: kiran
            Priority: Minor


SolrStream sets hashQ filter to the query even when numWorkers is zero. 
partitionFilter should only be set if numWorkers > 0. Otherwise, it will lead 
to error messages like 

{code}
2017-04-07 17:48:16,095 [qtp2012219613-152] ERROR HttpSolrCall  - 
null:java.io.IOException: java.lang.RuntimeException: 
java.lang.ArithmeticException: / by zero
    at 
org.apache.solr.search.HashQParserPlugin$HashQuery.createWeight(HashQParserPlugin.java:130)
    at 
org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:752)
    at 
org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:735)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:473)
{code}

This only happens when partitionKeys is set in params and streamContext is not 
set. 

How to replicate: The following code will fail with the above error message^

{code}
    SolrQuery query = new SolrQuery("*:*");
    query.set("fq", "{!hash workers=2 worker=0}");
    query.set("partitionKeys", "_version_");
    query.set("distrib", "false");
    String shardUrl = "http://localhost:8983/solr/test_shard1_replica1";;
    SolrStream stream = new SolrStream(shardUrl, query);
    stream.open();
    Tuple tuple = stream.read();
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to