Skip to content

5 ‐ Procedimentos ILM

viniciusbktech edited this page May 17, 2024 · 3 revisions
PUT _index_template/sales
{
  "index_patterns": ["vendas-*"], 
  "template": {
    "mappings": {
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "Category": {
          "type": "keyword"
        },
        "City": {
          "type": "keyword"
        },
        "Country": {
          "type": "keyword"
        },
        "CustomerName": {
          "type": "keyword"
        },
        "DaystoShipActual": {
          "type": "long"
        },
        "DaystoShipScheduled": {
          "type": "long"
        },
        "Discount": {
          "type": "double"
        },
        "OrderDate": {
          "type": "date",
          "format": "iso8601"
        },
        "OrderID": {
          "type": "keyword"
        },
        "OrderProfitable": {
          "type": "keyword"
        },
        "PostalCode": {
          "type": "long"
        },
        "ProductName": {
          "type": "text"
        },
        "Profit": {
          "type": "long"
        },
        "ProfitRatio": {
          "type": "double"
        },
        "Quantity": {
          "type": "long"
        },
        "Region": {
          "type": "keyword"
        },
        "Sales": {
          "type": "long"
        },
        "SalesForecast": {
          "type": "long"
        },
        "SalesaboveTarget": {
          "type": "keyword"
        },
        "SalesperCustomer": {
          "type": "double"
        },
        "Segment": {
          "type": "keyword"
        },
        "ShipDate": {
          "type": "date",
          "format": "iso8601"
        },
        "ShipMode": {
          "type": "keyword"
        },
        "ShipStatus": {
          "type": "keyword"
        },
        "State": {
          "type": "keyword"
        },
        "Sub_Category": {
          "type": "keyword"
        },
        "latitude": {
          "type": "double"
        },
        "location": {
          "type": "geo_point"
        },
        "longitude": {
          "type": "double"
        }
      }
    },
    "settings": {
      "index": {
        "number_of_shards": "1",
        "number_of_replicas": "1"
      }
    }
  }
}
POST vendas/_doc
{
  "Category": "Office Supplies",
  "Discount": 0,
  "ProductName": "Xerox 214",
  "latitude": 41.6347,
  "PostalCode": 2740,
  "ShipStatus": "Shipped Early",
  "OrderID": "CA-2014-148355",
  "Segment": "Corporate",
  "SalesaboveTarget": "null",
  "Sales": 19,
  "SalesperCustomer": 19.44,
  "Profit": 9,
  "ShipMode": "Standard Class",
  "CustomerName": "Nick Crebassa",
  "DaystoShipScheduled": 6,
  "longitude": -70.9372,
  "Sub_Category": "Paper",
  "ProfitRatio": 48,
  "Quantity": 3,
  "City": "New Bedford",
  "ShipDate": "2014-12-29T00:00:00.000Z",
  "SalesForecast": 25,
  "OrderDate": "2014-12-25T00:00:00.000Z",
  "OrderProfitable": "null",
  "@timestamp": "2014-12-25T00:00:00.000Z",
  "State": "Massachusetts",
  "Country": "United States",
  "Region": "East",
  "location": "41.6347,-70.9372",
  "DaystoShipActual": 4
}
PUT vendas-000001
{
  "aliases": {
    "vendas": {
      "is_write_index": true
    }
  }
}