java


inserting json into solr 5.5


The following is my code:
HttpPost postRequest = new HttpPost("http://localhost:8983/solr/core1/update/json?wt=json&commit=true");
StringEntity entity = new StringEntity("{\n"
+ " \"id\": \"1\",\n"
+ " \"title\": \"Doc 1\"\n"
+ "}", "UTF-8");
entity.setContentType("application/json");
postRequest.setEntity(entity);
HttpResponse response = httpClient.execute(postRequest);
when i am trying to add json to solr 5.5.0 , i got the below exception:
{"responseHeader":{"status":400,"QTime":2},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],"msg":"Unknown command 'id' at [9]","code":400}}
Can anyone please help me???

Related Links

Maven dependency on original Spring Boot JAR [duplicate]
Java local variable notation: 'textEntered' or 'enteredText'? [closed]
How SLF4J/ JPA / JAX-RS find their implementation?
Java - Creating multiple objects and making them distinguishable
Hibernate starts altering on tables which didn't created
Giving priority to some processes, without starvation for the others [closed]
JaCoCo coverage report not displayed in Sonarqube 5.3
How to change user in hdfs using sparkSubmit in java
What is the difference between Files.walk.filter and Files.find?
Java: Filtering Panels like a JTable
Auto Extracting XPATH of all html elements using JAVA
How to convert em dash in java
Is Java's import keyword for source files or binary files?
PostgreSQL function to insert into tables.. i need it to return specific values on errors and on specific if conditions
Have to click twice to get number, Java program not working as intended
Eclipse Java Compiler Errors

Categories

HOME
log4j
openlayers
hive
cookies
syntax
mean-stack
razor
webpack-2
azure-media-services
floating-action-button
handsontable
google-apps-marketplace
visual-studio-cordova
worldwind
angular-ui
solaris-10
nas
scriptcs
realex-payments-api
bootstrap-tour
sqlcipher
one-to-many
linkerd
assistant
gsmcomm
r-raster
react-chartjs
javascriptcore
jspresso
fog
qwerty
retina-display
hilbert-curve
opshub
unixodbc
checkboxlist
.net-4.6.2
taffy
rails-routing
powercli
brightcove
sybase-asa
django-scheduler
heidisql
grails-tomcat-plugin
etsy
django-debug-toolbar
contact-list
angstrom-linux
lua-5.1
bluemix-app-scan
natvis
jfugue
iad
r-tree
qtableview
intellij-14
ionic
graph-drawing
dereference
offloading
java-metro-framework
flask-cors
sgen
uv-mapping
ril
http-unit
libstdc++
trusted
first-responder
ocx
netbeans-6.9
jquery-ui-layout
hgsubversion
datareader
sproutcore-2
fixed-width
firefox4
noscript
text-coloring
port-number
post-build

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App