Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7805907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:21:45+00:00 2026-06-02T02:21:45+00:00

I am running Solr on Windows7 and cannot use Curl on cmd so I

  • 0

I am running Solr on Windows7 and cannot use Curl on cmd so I am using post.jar. (Yes I use Cygwin and Mingw but would like to stick to cmd.exe for this scenario).

Is there a way that I can add a document via post.jar by its tags directly at the command instead of creating an xml document and then adding that xml doc to the command?

Specifically, if I add the following tags in an xml file, the document gets uploaded beautifully:

<add><doc><field name="id">50</field><field name="title">Test Title</field><field name="author">Dan</field><field name="content">Test using post.jar </field></doc></add>

However, if I try to add the same tags at the command it sends me a bad request error:

Input at Cmd:

java -Ddata=args  -jar post.jar "<add><doc><field name="id">50</field><field name="title">Test Title</field><field name="author">Dan</field><field name="content">
 Test using post.jar </field></doc></add>" 

Returns:

SimplePostTool: FATAL: Solr returned an error: Bad Request

I cannot find any documentation or examples on adding data to solr via post.jar without it being an external xml file.
Deleting works great though:

java -Ddata=args  -jar post.jar '<delete><id>42</id></delete>'

Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:21:47+00:00Added an answer on June 2, 2026 at 2:21 am

    Okay, I’ve figured it out. For anyone who may run into this in the future:

    java -Ddata=args  -jar post.jar "<add><doc><field name=\"id\">17</field></doc></add>"
    

    Make sure you double quote the xml tags and escape the internal tag double quotes with a “\”. For example, I double quoted the xml tags from <add> to </add>. Also, I had to escape the quotes around the field id. Make sure to do this with all of your fields and it will submit.

    Additionally, if you are developing with java, make sure you escape both for the slash and quote. For example, the last argument in my ProcessBuilder string are my tags which look like:

    "<add><doc><field name=\\\"id\\\">17</field></doc></add>"
    

    Notice the extra slashes for escaping in java.

    I hope this helps someone out there… Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have solr up and running but I cannot get the results when I
Does running multiple Solr shards on a single machine improve performance? I would expect
ok, I'm totally new to SOLR and Lucene, but have got Solr running out-of-the-box
I'm using an app that has SOLR embedded. SOLR is running as a war
I had Solr 1.2 up and running at port 8983 and using liferay 5.1.1
I am running Solr on my windows machine using jetty. I have downloaded the
I am doing some test using WordDelimiterFilter in Solr but it doesn't preserve the
I am running a Solr instance on Jetty and when I search using the
I am using Apache Solr for search. I use this to provide personal user-based
I'm using solr version 1.4.0 with tomcat 6. I've 2 solr instances running as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.