Your builder parameter should be up to the collection, so only "http://testserver-dtv:8984/solr/cpsearch". Then, on your Query object, you set query.setRequestHandler("/select_cpsearch") as per https://lucene.apache.org/solr/8_6_2/solr-solrj/org/apache/solr/client/solrj/SolrQuery.html#setRequestHandler-java.lang.String-
I am not sure what is happening with your ping, but I also believe that there is a definition by default in the latest Solr. You could see all the definitions (including defaults), by using config API (see. https://lucene.apache.org/solr/guide/8_6/config-api.html) Regards, Alex. On Fri, 18 Sep 2020 at 15:18, Steven White <swhite4...@gmail.com> wrote: > > Hi Erick, > > I'm on Solr 8.6.1. I did further debugging into this and just noticed that > my search is not working too now (this is after I changed the request > handler name from "select" to "select_cpsearch"). I have this very basic > test code as a test which I think revailes the issue: > > try > { > SolrClient solrClient = new HttpSolrClient.Builder(" > http://testserver-dtv:8984/solr/cpsearch/select_cpsearch").build(); > SolrQuery query = new SolrQuery(); > query.set("q", "*"); > QueryResponse response = solrClient.query(query); > } > catch (Exception ex) > { > ex.printStackTrace(); // has this: > "<tr><th>URI:</th><td>/solr/cpsearch/select_cpsearch/select</td></tr>" > } > > In the stack, there is this message (I'm showing the relevant part only): > > <title>Error 404 Not Found</title> > </head> > <body><h2>HTTP ERROR 404 Not Found</h2> > <table> > <tr><th>URI:</th><td>/solr/cpsearch/select_cpsearch/select</td></tr> > > As you can see "select" got added to the URI. I think this is the root > cause for the ping issue too that I'm having, but even if it is not, I have > to fix this search issue too but I don't know how to tell SolrJ to use my > named search request handler. Any ideas? > > Thanks. > > Steven > > > On Fri, Sep 18, 2020 at 2:24 PM Erick Erickson <erickerick...@gmail.com> > wrote: > > > This looks kind of confused. I’m assuming what you’re after is a way to get > > to your select_cpsearch request handler to test if Solr is alive and > > calling that > > “ping”. > > > > The ping request handler is just that, a separate request handler that you > > hit by going to > > http://sever:port/solr/admin/ping. > > > > It has nothing to do at all with your custom search handler and in recent > > versions of > > Solr is implicitly defined so it should just be there. > > > > Your custom handler is defined as > > <requestHandler name="/select_cpsearch" class="solr.SearchHandler”> > > presumably in some collection called “cpsearch”? > > > > yet your URL is solr/cpsearch. It should be something like > > …solr/cpsearch/select_cpsearch… > > > > The “qf” parameter is part of the (e)dismax query parser which it doesn’t > > look like you’re using. > > > > So let’s back up a bit and state, at a high level, what you want to > > accomplish. > > > > First, what version of Solr? in recent Solr versions. > > > > Then the full definition of your custom request handler. > > > > Then an example of exactly how you try to get to it from a browser > > ‘cause that’s easier to try to reproduce than SolrJ. > > > > Best, > > Erick > > > > > On Sep 18, 2020, at 12:53 PM, Steven White <swhite4...@gmail.com> wrote: > > > > > > <requestHandler name="/select_cpsearch" class="solr.SearchHandler"> > > > >