1

What I have: Apache Solr 5.2.1

What I want: add a new document in a specific core defined by me

example: address of the solr core -->

http://IP_ADDRESS:8984/solr/myCustom_core/

I want to add a document json formed by {"id":"00001","title":"my title"} to the core above directly from the browser's url bar.

Problem: I'm trying to address this problem in such a way:

 http://IP_ADDRESS:8984/solr/myCustom_core/update?wt=json&{add:{"id":"00001","title":"my title"}}&commit=true

The response of the browser is:

{"responseHeader":{"status":0,"QTime":88}}

However, when I check on the server side the new entry is not added.

Conversely,it is works if I try to add such a document using the submit command provided in the UI of Solr.

Can someone provide me the correct way to build the correct url address? Thanks

EDIT: thanks to MatsLindh I solved my problem using this:

http://IP_ADDRESS:PORT/solr/myCustom_core/update?stream.body=<add><doc><field name="exampleField">example value</field></doc></add>&commit=true

1 Answer 1

3

You can use stream.body to send an arbitrary content stream through GET variables instead of using POST (or a regular body).

Be sure to perform appropriate escaping of the content you use in your URL.

You'll also have to perform a commit before the submitted content becomes searchable, either through commit=true in the request or by issuing a separate commit request.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.