NEST Client - Mapping, aggregations, search for dynamic properties/attributes of a model

Hi,
Could someone please help me to solve this problem.

We are trying to integrate elasticsearch in our project using NEST Client.

For our project we will have different schema per customer or product.

e.g. cars, books, drinks, clothes, gifts etc

In all scenarios data can be millions and updates frequently.

How can we create mapping when the

model has some fixed and many dynamic properties (or attributes). Some props are nested and nested objects have some fixed and some dynamic properties ?

And also we need to do aggregations, search etc on the web application.

Can we solve this problem? Is NEST client or REST api is better to solve this problem?
e.g. Model 1

{
  "id": 1,
  "productid": "123",
  "description": "BMW 1 Series",
  "division": {
    "value": "UK",
    "description": "United Kingdom"
  },
  "vehicletype": {
    "value": "Car",
    "description": "Car"
  },
  "bodystyle": {
    "value": "HATCHBACK",
    "description": "Hatchback"
  },
  "mileage": {
    "value": "10000",
    "description": "10,000 miles"
  },
  "price": {
    "value": "8991",
    "description": "£8,991.00 cash price"
  },
  "market": [
    {
      "id": 1,
      "description": "london",
      "macroarea": "LN",
      "salesmanager": "manager",
      "salesprice": 8991,
      "cost": 8991,
      "history": [
        {
          "historydate": "2020-03-31",
          "quantity": 1,
          "ordlines": 1
        },
        {
          "historydate": "2020-03-31",
          "quantity": 1,
          "ordlines": 1
        }
      ]
    }
  ]
}

e.g. Model 2

{
  "id": 20,
  "productid": "abc",
  "description": "description",
  "category": {
    "value": "category",
    "description": "category"
  },
  "supercategory": {
    "value": "supercategory",
    "description": "supercategory"
  },
  "servicetype": {
    "value": "N",
    "description": "N"
  },
  "itemstatus": {
    "value": "A",
    "description": "A"
  },
  "vendor": {
    "value": "123",
    "description": "123"
  },
  "market": [
    {
      "id": 1,
      "description": "market 1",
      "salesareatype": "market type",
      "area": "area",
      "cost": 7.95957,
      "history": [
        {
          "historydate": "2020-01-31T00:00:00",
          "quantity": 4,
          "ordlines": 0,
          "exquantity": 0
        },
        {
          "historydate": "2020-06-30T00:00:00",
          "quantity": 4,
          "ordlines": 0,
          "exquantity": 0
        }
      ]
    }
  ]
}

Thank you,
Krishna

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.