Click here to Skip to main content
15,880,364 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I want to insert data int solr through my application, I am using elasticsearch to store data to insert data in to elastic search I am usong following request :
"POST http://192.168.0.164:9200/_bulk HTTP/1.1
Host: 192.168.0.164:9200
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;)
Pragma: no-cache
Content-Type: application/x-www-form-urlencoded
Content-Length: 307"

"{"index":{"_index": "16-03-2016-sslindex","_type":"session"}}
{"UniqueID":"2016-3-16-10-45-19-1-1","Time":"2016-3-16T10:45:19","SrcIp":"192.168.0.180","SrcPort":1123,"DstIp":"74.125.68.113","DstPort":443,"InterfaceID":"1","LocationID":2,"Size":0,"Snortname":"p_snort.log.123","Dummy1":"","Dummy2":0}"



I want to use solr in same ways. what should be the request structure so as to insert valye in to solr.

What I have tried:

I had tried the request POST http://192.168.0.164:8983/solr/collection1/update?wt=json HTTP/1.1
Host: 192.168.0.164:8983
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json
X-Requested-With: XMLHttpRequest
Referer: http://192.168.0.164:8983/solr/
Content-Length: 106
Connection: keep-alive
"{"add":{ "doc":{"id":"change.me","from":"change.me"},"boost":1.0,"overwrite":false,"commitWithin":1000}}"

but it is not working
Posted
Updated 10-May-16 1:11am
v2

1 solution

> but it is not working
That tells us nothing about what you have tried, or what the problem is.

I suggest you try some of the tutorials and documentation on the Apache Solr[^] website.
 
Share this answer
 
Comments
Member 11242809 10-May-16 7:04am    
I want to insert data into solr as i am doing it in elasticsearch. but I don't know the exact http request for insertion of data. I had shared the http request which I am using for elasticsearch data insertion.
Richard MacCutchan 10-May-16 11:47am    
Then follow the link above and check the documentation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900