lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyer, James" <>
Subject RE: Index database with SolrJ using xml file directly throws an error
Date Thu, 28 Feb 2019 19:00:22 GMT
The parameter "dataConfig" should hold an actual xml document to override the data-config.xml
file you store in zookeeper (cloud) or the configuration directory (standalone).  Typically
you do not use this parameter.  Instead, specify the "config" parameter with the filename
(eg. data-config.xml).  This file is the DIH configuration, not solrconfig.xml as you are
using.  It is just the filename, or path starting at the base configuration directory, not
a full path as you are using.  Unless you want users to override the DIH configuration at
request time, it is best to specify the filename using the "config" parameter in the request
handler's invariant section in solrconfig.xml.

From: sami <>
Sent: Thursday, February 28, 2019 8:36 AM
Subject: Index database with SolrJ using xml file directly throws an error

I would like to index my database using SolrJ Java API. I have already tried
to use DIH directly from the Solr server. It works and indexes well. But
when I would like to use the same XML config file with SolrJ it throws an

**Solr version 7.6.0 SolrJ 7.6.0**

Here is the full code I am using:

String url = "http://localhost:8983/solr/test";
String dataConfig =
HttpSolrClient server = new HttpSolrClient.Builder(url).build();
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("qt", "/dataimport");
params.set("command", "full-import");
params.set("clean", "true");
params.set("commit", "true");
params.set("optimize", "true");

But using this piece of code throws an error.

Exception in thread "main"
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error
from server at http://localhost:8983/solr/test: Data Config problem: Content
is not allowed in Prolog.

Am I doing it right? Reference:<>

Is there any other way to index directly.

Sent from:<>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message