# addDocs

State Resource

This is a State Resource as provided by the tymly-solr-plugin plugin.

# Purpose

Adds docs

# Usage

# Example

{
  "FormatDocs": {
    "Type": "Map",
    "InputPath": "$",
    "ItemsPath": "$.incidents",
    "Iterator": {
      "StartAt": "Shape",
      "States": {
        "Shape": {
          "Type": "Pass",
          "Parameters": {
            "id.$": "States.Format('incident#{}', $.id)",
            "docId.$": "$.id",
            "domain": "search",
            "docType": "incident",
            "title.$": "States.Format('Incident {}/{}', $.id, $.year)",
            "description.$": "$.label",
            "category": "iip",
            "point.$": "States.Format('{},{}', $.lat, $.lon)",
            "activeEvent": true,
            "author": "incident",
            "roles.$": "States.Array('$authenticated')",
            "language": "ENG",
            "sortString.$": "$.id",
            "launches.$": "States.JsonToString($.launches)",
            "created": "$NOW",
            "modified": "$NOW"
          },
          "OutputPath": "$.solrDoc",
          "ResultPath": "$.solrDoc",
          "End": true
        }
      }
    },
    "ResultPath": "$.incidentSolrDocs",
    "Next": "AddDocs"
  },
  "AddDocs": {
    "Type": "Task",
    "Resource": "module:addDocs",
    "InputPath": "$.incidentSolrDocs",
    "ResultPath": "$",
    "End": true
  }
}

# Options

Last Updated: 9/10/2023, 11:30:14 AM