On 8/16/2011 4:16 AM, olivier sallou wrote:
I just migrated to solr 3.3 from 1.4.1.
My index is still in 1.4.1 format (will be migrated soon).
I have an error when I use sharding with the new version:
org.apache.solr.common.SolrException: java.lang.RuntimeException: Invalid
version (expected 2, but 1) or the data in not in 'javabin' format
However, if I request each shard independently (/request), answer is
correct. So the error is triggered only with the shard mechanism.
In version 3.1, the javabin format was changed, it's completely
incompatible with 1.4.1 and earlier at the application level, which
should have nothing to do with the index format. Javabin is used in
distributed search and by SolrJ.
It sounds like you either have an old SolrJ version talking to the new
Solr version, or you are requesting data from your shards using an old
version of Solr. If it's the latter, just upgrade the Solr instance
that serves as the broker/middleman between your application and your
shards.
If it's SolrJ, you have two choices. You can either upgrade your SolrJ
jar and the jars found in solrj-lib, or keep using the old version and
add the following line to your code right after your server object is
created. This tells SolrJ to use the XML format, which works on any
version:
server.setParser(new XMLResponseParser());
You'll also need to import
org.apache.solr.client.solrj.impl.XMLResponseParser for the above line
to work.
Thanks,
Shawn