SolrConfig Override from SolrJ

61 views Asked by At

I am trying to use SolrConfig API to override SolrConfig.xml file, but failed. Cmd doesn't allow to use multi-line commands. Either way, I'd rather do everything from the SolrJ API, because my entire project is written in Java. Could Someone please tutor me briefly on how is that done?

If not, can you please explain how do I write multiple line commands? Edit: I should have included the command I tried running, sorry. this command is used to create a request handler:

curl http://localhost:8983/solr/techproducts/config -H 'Content-type:application/json'  -d '{
  "add-requesthandler" : {
"name": "/mypath",
"class":"solr.DumpRequestHandler",
"defaults":{ "x":"y" ,"a":"b", "wt":"json", "indent":true },
"useParams":"x"
}
}'

and the cmd takes it as one line as a time. Is this code even for cmd? honestly though, I don't get the syntax in general.

1

There are 1 answers

0
double-beep On BEST ANSWER

If I understood well, you want to learn if there are multi-line commands in cmd.

If you mean to split a long command to multiple lines the answer is YES. Please refer to Long commands split over multiple lines in Windows Vista batch (.bat) file.

If you mean to run multiple command at once the answer is again YES. Try:

command 1 && command 2 && command 3 [&& ...]

If you mean to run multiple commands in multiple lines, I will... AGAIN answer YES. You can try:

command 1 && ^
command 2 && ^
command 3
rem You can continue like the above.

Learn more about the ampersands (double [&&] and single [&]) and the || symbol in question What does "&&" in this batch file?: I would suggest you to take a look at the second answer.