2
votes

I have created a solr multi core and every thing is working as expected. But when I put SolrPhpClient and tried to ping the server(jetty) I am getting error that it's not running where as it is running.

I even tried the below given url:

http://localhost:8983/solr/core1/admin/ping then I get a 500 error.

I even tried to make changes in solrconfig.xml

  <requestHandler name="/core1/admin/ping" class="PingRequestHandler">
    <lst name="defaults">
      <str name="qt">standard</str>
      <str name="q">solrpingquery</str>
      <str name="echoParams">all</str>
    </lst>
  </requestHandler>

but even this didn't work.

Any ideas guys how to make SolrPhpClient work with multicore.

Any help will be appreciated.

2

2 Answers

2
votes

know this is old, but it might help someone else , trying this might fix soneones problem:

<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
  <lst name="invariants">
    <str name="q">solrpingquery</str>
  </lst>
  <lst name="defaults">
    <!--<str name="qt">standard</str>-->
    <str name="echoParams">all</str>
    <str name="df">user_namesearch</str>
  </lst>
    <!-- An optional feature of the PingRequestHandler is to configure the 
         handler with a "healthcheckFile" which can be used to enable/disable 
         the PingRequestHandler.
         relative paths are resolved against the data dir 
      -->
    <!-- <str name="healthcheckFile">server-enabled.txt</str> -->
  </requestHandler>

Make sure that you replace user_namesearch for an existing field in one of your cores. This is a general thing and if all of the cores do not share a common field, it will fail for other cores. Make sure that field is indexed.

To check go visit: solrserver:port/solr-4.0.0/your-core-name/admin/ping

If you want to create a test field, try to add this to the schema's of each core:

<field name="test" type="searchterms" indexed="true" stored="false" multiValued="true"/>

I haven't got ping to work in a 'general' fashion ever on solr 4.0 (which I believe is this post about). The test is 'per core', the field choice setting a general one afaik.

1
votes

When setting up your options for the SolrClient in PHP, you need to set the 'path' property to that of your core (ie 'solr/core1').

Then in your requestHandler in solrconfig.xml set the name back to '/admin/ping'.

This should solve your issues.