On Mon, May 14, 2012 at 3:11 PM, Rajesh Jain <rjai...@gmail.com> wrote:
> Hi Yonik
>
> i tried without the json in the URL, the result was same but in XML format

Interesting... the XML response is fine (just not ideal).

When I tried it, I did get a JSON response (perhaps I'm running a
later version of trunk... the unified update handler is very new)

$ curl 'http://localhost:8983/solr/update?commit=true' --data-binary
@books.json -H 'Content-type:application/json'
{"responseHeader":{"status":0,"QTime":133}}

-Yonik
http://lucidimagination.com


>
> C:\Tools\Solr\apache-solr-4.0-2012-05-04_08-23-31\example\exampledocs>C:\tools\curl\curl
> http://localhost:8983/solr/update?commit=true --data-binary @money.json -H
> 'Content-type:application/json'
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">45</in
> /lst>
> </response>
>
>
>
>
> On Mon, May 14, 2012 at 2:58 PM, Yonik Seeley <yo...@lucidimagination.com>
> wrote:
>>
>> I think this may be due to https://issues.apache.org/jira/browse/SOLR-2857
>> JIRA is down right now so I can't check, but I thought the intent was
>> to have some back compat.
>>
>> Try changing the URL from /update/json to just /update in the meantime
>>
>> -Yonik
>> http://lucidimagination.com
>>
>>
>> On Mon, May 14, 2012 at 2:42 PM, Rajesh Jain <rjai...@gmail.com> wrote:
>> > Hi Jack
>> >
>> > I am following the http://wiki.apache.org/solr/UpdateJSON tutorials.
>> >
>> > The first example is of books.json, which  I executed, but I dont see
>> > any
>> > books
>> >
>> > http://localhost:8983/solr/collection1/browse?q=cat%3Dbooks
>> >
>> > 0 results found in 26 ms Page 0 of 0
>> >
>> > I modified the books.json to add my own book, but still no result. The
>> > money.xml works, so I converted the money.xml to money.json and added an
>> > extra currency. I don't see the new currency.
>> >
>> > My question is, how do I know if the UpdateJSON action was valid, if I
>> > don't see them in the
>> > http://localhost:8983/solr/collection1/browse?q=cat%3Dbooks
>> >
>> > Is there a way to find what is happening - maybe through log files?
>> >
>> > I am new to Solr, please help
>> >
>> > Thanks
>> > Rajesh
>> >
>> >
>> >
>> >
>> > On Mon, May 14, 2012 at 2:33 PM, Jack Krupansky
>> > <j...@basetechnology.com>wrote:
>> >
>> >> Check the examples of update/json here:
>> >>
>> >>
>> >> http://wiki.apache.org/solr/**UpdateJSON<http://wiki.apache.org/solr/UpdateJSON>
>> >>
>> >> In your case, either leave out the "add" level or add a "doc" level
>> >> below
>> >> it.
>> >>
>> >> For example:
>> >>
>> >> curl
>> >> http://localhost:8983/solr/**update/json<http://localhost:8983/solr/update/json>-H
>> >> 'Content-type:application/
>> >> **json' -d '
>> >> {
>> >> "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
>> >> "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
>> >> }'
>> >>
>> >> -- Jack Krupansky
>> >>
>> >> -----Original Message----- From: Rajesh Jain
>> >> Sent: Monday, May 14, 2012 1:27 PM
>> >> To: solr-user@lucene.apache.org
>> >> Cc: Rajesh Jain
>> >> Subject: Update JSON not working for me
>> >>
>> >>
>> >> Hi,
>> >>
>> >> I am using the 4.x version of Solr, and following the UpdateJSON Solr
>> >> Wiki
>> >>
>> >> 1. When I try to update using :
>> >>
>> >> curl
>> >> 'http://localhost:8983/solr/**update/json?commit=true<http://localhost:8983/solr/update/json?commit=true>
>> >> '
>> >> --data-binary @books.json -H 'Content-type:application/**json'
>> >>
>> >> I don't see any Category as Books in Velocity based Solr Browser the
>> >>
>> >> http://localhost:8983/solr/**collection1/browse/<http://localhost:8983/solr/collection1/browse/>
>> >> ?
>> >>
>> >> I see the following message on the startup window when I run this
>> >> command
>> >> C:\Tools\Solr\apache-solr-4.0-**2012-05-04_08-23-31\example\**
>> >> exampledocs>C:\tools\curl\curl
>> >>
>> >> http://localhost:8983/solr/**update/json?commit=true<http://localhost:8983/solr/update/json?commit=true>--data-binary
>> >> @books
>> >> .json -H 'Content-type:application/**json'
>> >> {
>> >>  "responseHeader":{
>> >>   "status":0,
>> >>   "QTime":47}}
>> >>
>> >> 2. I wrote my own JSON file where I added an extra "add" directive
>> >>
>> >> My JSON File
>> >> [
>> >>  {
>> >> "add":{
>> >> "id" : "MXN",
>> >> "cat" : ["currency"],
>> >> "name" : "One Peso",
>> >> "inStock" : true,
>> >> "price_c" : "1,MXN",
>> >> "manu" : "384",
>> >> "manu_id_s" : "Bank Mexico",
>> >> "features":"Coins and notes"
>> >>     }
>> >>   }
>> >> ]
>> >>
>> >> I still don't see the addition in the existing Currency Categories.
>> >>
>> >>
>> >> Please let me know if the UPDATEJSON works in 4.x or is this only for
>> >> 3.6?
>> >>
>> >> Thanks
>> >> Rajesh
>> >>
>
>

Reply via email to