O'Reilly logo

Apache Solr Beginner's Guide by Alfredo Serafini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – indexing an example document with cURL

Now that we have defined our example document, let's index it! Steps for indexing an example document with cURL are as follows:

  1. The simplest way to send it for indexing is by using the cURL command-line tool:
    >> curl -X POST 'http://localhost:8983/solr/simple/update?commit=true&wt=json' -H 'Content-Type: text/xml' -d @docs.xml
    
  2. If you have named the file to be posted in a different way, just use your own name in the command. I assume that you are executing cURL from the /test/chp02 directory; if not, please use the full path name for your file.
  3. If everything goes well, you should receive output like the following:
    >> {'responseHeader':{'status':0,'QTime':901}}
    
  4. This result will inform us about ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required