0

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}
  ]
}'
2
  • Can someone please help me as I am stuck here from yesterday.Google it but my document is not getting added Commented Oct 25, 2016 at 8:53
  • Have you committed after adding the document? (add commit=true to your parameters, or submit a separate commit request) Commented Oct 25, 2016 at 12:08

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.