0
votes

Hi I am new to solr and trying to add an custom JSON.I am following the link https://cwiki.apache.org/confluence/display/solr/Transforming+and+Indexing+Custom+JSON. First I created a core using below command.solr create -c my_collection -d data_driven_schema_configs. after that I added the below content from cygwin to my core.But when I am enquiring through http://localhost:8983/solr/my_collection/select?wt=json&q=* it is saying no doc.{"responseHeader":{"status":0,"QTime":1,"params":{"q":"*","wt":"json"}},"response":{"numFound":0,"start":0,"docs":[]}}

curl 'http://localhost:8983/solr/my_collection/update/json/docs'\
'?split=/exams'\
'&f=first:/first'\
'&f=last:/last'\
'&f=grade:/grade'\
'&f=subject:/exams/subject'\
'&f=test:/exams/test'\
'&f=marks:/exams/marks'\
 -H 'Content-type:application/json' -d '
{
  "first": "John",
  "last": "Doe",
  "grade": 8,
  "exams": [
    {
      "subject": "Maths",
      "test"   : "term1",
      "marks"  : 90},
    {
      "subject": "Biology",
      "test"   : "term1",
      "marks"  : 86}
  ]
}'
1
Can someone please help me as I am stuck here from yesterday.Google it but my document is not getting addedVikash
Have you committed after adding the document? (add commit=true to your parameters, or submit a separate commit request)MatsLindh

1 Answers

0
votes

The query should be *:*, not just *. Just check in Admin UI and do default search.