I am using apache solr-6.0.0
I have a collection : my-search
whenever I run a delta-import, the last_index_time in the dataimport.properties file is getting updated.
Is there a way to get this value using an api call? and if Yes how can that value be read using solrj library?
using the following api I am able to read the content of the file:
http://localhost:8983/solr/my-search/admin/file?wt=json&file=dataimport.properties
The response looks like :
#Thu Mar 23 10:00:01 UTC 2017
name.last_index_time=2017-03-23 10\:00\:01
last_index_time=2017-03-23 10\:00\:01
using solrj java library, I am doing the following:
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("qt", "/admin/file");
params.set("file", "dataimport.properties");
params.set("contentType", "text/plain;charset=utf-8");
try
{
return this.solr.query(collectionName, params);
}
catch (Exception e)
{
logger.info("Exception msg: " + e.getMessage());
}
But I am getting error saying:
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/cdi-search: Expected mime type application/octet-stream but got text/plain. #Thu Mar 23 10:00:01 UTC 2017
name.last_index_time=2017-03-23 10\:00\:01
last_index_time=2017-03-23 10\:00\:01
I changed the contentType to application/octet-stream. But now the error is :
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/cdi-search: Invalid version (expected 2, but 35) or the data in not in 'javabin' format
datainto thedataimport.propertiesfile? - freedev