Index Profiles API

Index profiles are used to send documents to consistent endpoints, and to share pipelines among different collections. For information on using this service through the UI, see Index Profiles.

Create, List, Update or Delete an Index Profile

The path for this request is:

/api/apollo/collections/<collectionName>/index-profiles/<profileName>

where <collectionName> is the name of an specific collection and <profileName> is the name of a new or existing profile.

  • GET - returns the details of the profile, or all profiles for the collection is profile name is not specified.

  • PUT - create a new profile or update an existing one. No response returned.

  • DELETE - remove the profile. No response returned.

Use a Profile to Index Documents

A set of Fusion PipelineDocument objects in JSON can be indexed directly via a POST to endpoints:

/api/apollo/collections/<collectionName>/index-profiles/<profileName>/index

/api/apollo/collections/<collectionName>/index-profiles/<profileName>/debug

where <collectionName> is the name of an specific collection and <profileName> is the name of a new or existing profile.

A POST to the index endpoint indexes the document. A POST to the debug endpoint indexes the document and outputs information about the state of the pipeline document after each stage. See also the Index Pipelines API.

Both endpoints allow the following query parameters:

Parameter Description

simulate

If true, documents will not be sent to solr for indexing, i.e., the solr-index stage will be skipped. The default is false.

echo

This parameter is only available with the the index endpoint.

If true, the default, the list of documents indexed will be returned. If this is set to false, no output will be returned when the pipeline has finished.

bufferDocsForSolr

If true, documents will be buffered before sending to Solr. This is an asynchronous mode and may give faster performance when indexing a large number of documents. The default is false.

The output will include a JSON representation of the documents after they have passed through the pipeline, unless the echo query parameter has been set to 'false'.

Examples

Create a profile named 'testProfile' for the 'docs' collection and associate it with the pipeline named 'docs-default':

REQUEST

curl -u user:pass -X PUT -H 'Content-type: application/json' -d '"docs-default"' http://localhost:8764/api/apollo/collections/docs/index-profiles/testProfile

RESPONSE

None.

Index two simple documents with the profile named 'testProfile':

REQUEST

curl -u user:pass -X POST -H "Content-Type: application/vnd.lucidworks-document" -d '[{"id": "myDoc1","fields": [{"name":"title", "value":"My first document"},{"name":"body", "value": "This is a simple document."}]},{"id": "myDoc2","fields": [{"name":"title","value": "My second document"},{"name":"body", "value": "This is another simple document."}]}]' http://localhost:8764/api/apollo/collections/docs/index-profiles/testProfile/index

RESPONSE

[ {
  "id" : "myDoc1",
  "fields" : [ {
    "name" : "content",
    "value" : "This is a simple document.",
    "metadata" : { },
    "annotations" : [ ]
  }, {
    "name" : "title",
    "value" : "My first document",
    "metadata" : { },
    "annotations" : [ ]
  }, {
    "name" : "parsing_s",
    "value" : "no_raw_data",
    "metadata" : {
      "creator" : "tika-parser"
    },
    "annotations" : [ ]
  }, {
    "name" : "parsing_time_l",
    "value" : [ "java.lang.Long", 6 ],
    "metadata" : { },
    "annotations" : [ ]
  } ],
  "metadata" : { },
  "commands" : [ ]
}, {
  "id" : "myDoc2",
  "fields" : [ {
    "name" : "content",
    "value" : "This is another simple document.",
    "metadata" : { },
    "annotations" : [ ]
  }, {
    "name" : "title",
    "value" : "My second document",
    "metadata" : { },
    "annotations" : [ ]
  }, {
    "name" : "parsing_s",
    "value" : "no_raw_data",
    "metadata" : {
      "creator" : "tika-parser"
    },
    "annotations" : [ ]
  }, {
    "name" : "parsing_time_l",
    "value" : [ "java.lang.Long", 0 ],
    "metadata" : { },
    "annotations" : [ ]
  } ],
  "metadata" : { },
  "commands" : [ ]
} ]