You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Darniz <rn...@edmunds.com> on 2012/11/26 10:26:26 UTC

error while doing partial update using curl

Hello
i am trying to update a filed in my solr doc using curl, dont know why its
giving me this error when i try to do this statment

curl 'myhostname:8080/solr/update?commit=true' -H
'Content-type:application/json' -d
'[{"id":"contentId#63481697","price":{"set":16595}}]'

i am getting this error
<response>
<lst name="responseHeader"><int name="status">400</int><int
name="QTime">0</int></lst><lst name="error"><str name="msg">Unexpected
character '[' (code 91) in prolog; expected '&lt;'
 at [row,col {unknown-source}]: [1,1]</str><int name="code">400</int></lst>
</response>

any help will be appreciated.

Thanks




--
View this message in context: http://lucene.472066.n3.nabble.com/error-while-doing-partial-update-using-curl-tp4022313.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: error while doing partial update using curl

Posted by Darniz <rn...@edmunds.com>.
Sorry for urgency, but i tried many different things i would appreciate if
anyone can provide solution for this.




--
View this message in context: http://lucene.472066.n3.nabble.com/error-while-doing-partial-update-using-curl-tp4022313p4022408.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: error while doing partial update using curl

Posted by Darniz <rn...@edmunds.com>.
Thanks for the reply

i checked the solr version and we do use exact version
4.0.0.2012.10.06.03.04.33

and also i have posted my solconfig.xml file snippet, and your assumption
was correct, it did used XmlUpdateRequestHandler.

<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" /> 

Do you know whats the correct way to provide xml in order to do partial
update.

This wiki here suggested me to do partial updating, which is not working for
me
http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22field.22








--
View this message in context: http://lucene.472066.n3.nabble.com/error-while-doing-partial-update-using-curl-tp4022313p4022589.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: error while doing partial update using curl

Posted by Chris Hostetter <ho...@fucit.org>.
: i tried issuing a command using curl with xml syntax and it turns out that it
: replace my whole documents rather than updating a specific field this is
: what i gave, i got an impression providing update=set will only changes that
: field rather than reindexing the entire document. Any idea how to issue
: partial updates

What version of solr are you using? partial doc updates is only supported 
in Solr 4.0.

As for your earlier mentioned problem...

: curl 'myhostname:8080/solr/update?commit=true' -H
: 'Content-type:application/json' -d
: '[{"id":"contentId#63481697","price":{"set":16595}}]'
:
: i am getting this error
: <response>
: <lst name="responseHeader"><int name="status">400</int><int
: name="QTime">0</int></lst><lst name="error"><str name="msg">Unexpected
: character '[' (code 91) in prolog; expected '&lt;'
:  at [row,col {unknown-source}]: [1,1]</str><int 
name="code">400</int></lst>
: </response>

...knowing your solr version and solrconfig.xml configuration for the 
"/update" handler is also important here ... according to that error, it 
looks like you are using the "solr.XmlUpdateRequestHandler" which requires 
XML input (as opposed to the "solr.UpdateRequestHandler" new in SOlr 4.0 
which looks at the COntent-Type to select the input format)


-Hoss

Re: error while doing partial update using curl

Posted by Darniz <rn...@edmunds.com>.
i tried issuing a command using curl with xml syntax and it turns out that it
replace my whole documents rather than updating a specific field this is
what i gave, i got an impression providing update=set will only changes that
field rather than reindexing the entire document. Any idea how to issue
partial updates

curl http://host:8080/solr/update?commit=true -H 'Content-type:text/xml' -d
'<add><doc><field name="id">63481697</field><field name="authorGender"
update="set">male</field></doc></add>'





--
View this message in context: http://lucene.472066.n3.nabble.com/error-while-doing-partial-update-using-curl-tp4022313p4022416.html
Sent from the Solr - User mailing list archive at Nabble.com.