Hi Alfonso,
could you please paste an extract of the client code? Specifically those few lines where you create the SolrQuery with params.

The line you mentioned is dealing with ContentStream which as far as I remember wraps the request body, and not the request params. So as request body Solr expects a valid JSON payload, but in your case, if I got you, you're sending plain query parameters (through SolrJ).

Best,
Andrea

On 29/08/2018 12:45, Alfonso Noriega wrote:
Hi,
I am implementing a migration of Vind
<https://github.com/RBMHTechnology/vind> library from solr 5 to 7.4.0 and I
am facing an error which I have no idea how to solve...

The library provides a wrapper (and some extra stuff) to develop search
tools over Solr and uses SolrJ to access it, more info about it can be seen
in the public repo, but basically all requests are done to solr through a
client provided by solrj.
Actually, the migration is done and the tests running against a cloud
instance are working perfectly fine. The issue arises when testing against
an embedded server (which is the default case as you may not have a local
solr instance running), in which case every request fails throwing the
following exception:
*org.apache.solr.common.SolrException: Bad contentType for search handler
:application/javabin request={q=!(+_id_:P3)AND(_root_:P3)}*

* at
org.apache.solr.request.json.RequestUtil.processParams(RequestUtil.java:73)*
* at
org.apache.solr.util.SolrPluginUtils.setDefaults(SolrPluginUtils.java:167)*
* at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:196)*
* at org.apache.solr.core.SolrCore.execute(SolrCore.java:2539)*
* at
org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(EmbeddedSolrServer.java:191)*
* at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:194)*
* at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:974)*
* at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:990)*

After some debugging I have seen that the embedded solr server uses
*org.apache.solr.request.json.RequestUtil* to process the parameters which
invariable expects a '*application/json' *contentType but SolrJ prodcues as
*'application/javabin'.*
Any ideas on how to fix this issue?

The library has in the pom defined the following solr depedencies :
*.*
*.*
*.*

*<solr.version>7.4.0</solr.version>*
*.*
*.*
*.*
*<dependency>*
*    <groupId>org.apache.solr</groupId>*
*    <artifactId>solr-core</artifactId>*
*    <version>${solr.version}</version>*
*</dependency>*
*<dependency>*
*    <groupId>org.apache.solr</groupId>*
*    <artifactId>solr-solrj</artifactId>*
*    <version>${solr.version}</version>*
*</dependency>*

Thanks!

Reply via email to