Solr misc

Version 5 - Updated on 02 Nov 2017 at 11:02PM by Joachim Hansen

Description

Adding Multiple JSON Documents

Adding multiple documents at one time via JSON can be done via a JSON Array of JSON Objects, where each object represents a document:

curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/my_collection/update' --data-binary '
[
  {
    "id": "1",
    "title": "Doc 1"
  },
  {
    "id": "2",
    "title": "Doc 2"
  }
]'

A sample JSON file is provided at example/exampledocs/books.json and contains an array of objects that you can add to the Solr techproducts example:

curl 'http://localhost:8983/solr/techproducts/update?commit=true' --data-binary @example/exampledocs/books.json -H 'Content-type:application/json'

Similar to Elasticsearch but now we want array [], now we dont need action betweeen each document? Do I need to supply ID myself? Hopefully the datasets already have this field. 

look at the file example/exampledocs/books.json (to see how the bulk file need to be in order to be valid)



search time for SOLR is documented in  https://wiki.apache.org/solr/SolrTerminology 

Qtime should be present in the search result /response