Strange enough, the following code gives different errors:

    assertQ(
        req("q", "*:*", "debug", "true", "indent", "true"), 
            "//result/doc[1]/str[@name='id'][.='1']",
            "//result/doc[2]/str[@name='id'][.='2']",
            "//result/doc[3]/str[@name='id'][.='3']",
            "//result/doc[4]/str[@name='id'][.='4']");

[searcherExecutor-47-thread-1] INFO org.apache.solr.core.SolrCore - 
[collection1] Registered new searcher Searcher@765ea6c9[collection1] 
main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_0(5.3.0):C2)))}
[qtp137312325-79] INFO org.apache.solr.update.processor.LogUpdateProcessor - 
[collection1] webapp=/qc_as/x path=/update 
params={waitSearcher=true&commit=true&softCommit=false&wt=javabin&version=2} 
{commit=} 0 7
[TEST-TestComponent.test-seed#[EA2ED1E118114486]] INFO 
org.apache.solr.core.SolrCore.Request - [collection1] webapp=null path=null 
params={q=*:*&debug=true&indent=true&wt=xml} hits=0 status=0 QTime=7 
[TEST-TestComponent.test-seed#[EA2ED1E118114486]] ERROR 
org.apache.solr.SolrTestCaseJ4 - REQUEST FAILED: 
xpath=//result/doc[1]/str[@name='id'][.='1']
        xml response was: <?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">7</int>
</lst>
<result name="response" numFound="0" start="0">
</result>
<lst name="debug">
  <str name="rawquerystring">*:*</str>
  <str name="querystring">*:*</str>
  <str name="parsedquery">MatchAllDocsQuery(*:*)</str>
  <str name="parsedquery_toString">*:*</str>


And, when i forcfully add distrib=true, i get a NPE in SearchHandler!

[TEST-TestComponent.test-seed#[2BEFD39F89732741]] INFO 
org.apache.solr.core.SolrCore.Request - [collection1] webapp=null path=null 
params={q=*:*&distrib=true&debug=true&indent=true&wt=xml} 
rid=testNode-collection1-1441359642142-0 status=500 QTime=11 
[TEST-TestComponent.test-seed#[2BEFD39F89732741]] ERROR 
org.apache.solr.SolrTestCaseJ4 - REQUEST FAILED: 
q=*:*&distrib=true&debug=true&indent=true&wt=xml:java.lang.NullPointerException
        at 
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:341)
        at 
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:2068)
        at org.apache.solr.util.TestHarness.query(TestHarness.java:320)
        at org.apache.solr.util.TestHarness.query(TestHarness.java:302)
        at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:739)
        at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:732)



Also, this is on Solr 5.3.0.

Many thanks!
Markus

 
 
-----Original message-----
> From:Markus Jelsma <markus.jel...@openindex.io>
> Sent: Friday 4th September 2015 12:07
> To: solr-user <solr-user@lucene.apache.org>
> Subject: Trouble making tests with BaseDistributedSearchTestCase
> 
> Hello - i am trying to create some tests using BaseDistributedSearchTestCase 
> but two errors usually appear. Consider the following test:
> 
>   @Test
>   @ShardsFixed(num = 3)
>   public void test() throws Exception {
>     del("*:*");
> 
>     index(id, "1", "lang", "en", "text", "this is some text");
>     index(id, "2", "lang", "en", "text", "this is some other text");
>     index(id, "3", "lang", "en", "text", "more text");
>     index(id, "4", "lang", "en", "text", "just some text");
>     commit();
>                                                                               
>             
>     QueryResponse rsp;
>     rsp = query("indent", "true", "q", "*:*");
>     assertFieldValues(rsp.getResults(), id, 1, 2, 3, 4); 
>   }
> }
> 
> Executing the above text either results in a: IOException occured when 
> talking to server at: https://127.0.0.1:44761//collection1
> Or it fails with a curous error: .response.maxScore:1.0!=null
> 
> The score correctly changes according to whatever value i set for parameter q.
> 
> I have checked other tests that extend BaseDistributedSearchTestCase but many 
> are just as plain simple as the test above. Any idea as to what i am missing?
> 
> Many thanks!
> Markus
> 

Reply via email to