Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-117284

DDLRecords created via Data Engine do not have their custom attributes indexed on Elasticsearch

    Details

      Description

      Issue

      DDLRecords created via Data Engine do not have their custom attributes indexed on Elasticsearch.

      Steps to Reproduce

      testing in master

      1. Create the data definition in my site (siteId: 20122)

      curl -i -X POST \
        http://localhost:8080/o/data-engine/v2.0/sites/20122/data-definitions/by-content-type/native-object \
        -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
        -H 'Content-Type: application/json' \
        -d '{
          "availableLanguageIds": ["en_US"],
          "dataDefinitionFields": [
              {
                  "customProperties" : {
                    "dataType": "text"
                  },
                  "fieldType": "text",
                  "indexable": true,
                  "indexType": "text",
                  "name": "product"
              }
          ],
          "description": {
                  "en_US": "Description"
          },
          "name": {
                  "en_US": "Order"
          },
          "storageType":"json"
      }'
      

      2. Check the data definition's existence, and identify the data definition's ID

      curl -i -X GET \
        http://localhost:8080/o/data-engine/v2.0/sites/20122/data-definitions/by-content-type/native-object \
        -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
        -H 'Content-Type: application/json'
      

      3. Verify existence of record collection on data definition, and check for the record set's ID

      curl -i -X GET \
        http://localhost:8080/o/data-engine/v2.0/data-definitions/35121/data-record-collections \
        -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
        -H 'Content-Type: application/json'
      

      4. Add a record to the record collection (dataRecordSetId: 35123)

      curl -i -X POST \
          http://localhost:8080/o/data-engine/v2.0/data-record-collections/35123/data-records \
          -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
          -H 'Content-Type: application/json' \
          -d '{
              "dataRecordValues":
               {
                   "product": "Bicycle"
               }
        }'
      

      5. Check the record and assert that it's present (dataRecordSetId: 35123)

      curl -i -X GET \
          http://localhost:8080/o/data-engine/v2.0/data-record-collections/35123/data-records \
          -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
          -H 'Content-Type: application/json'
      

      6. Check startup logs for sidecar elastic search port ("Sidecar Elasticsearch properties"), and check elasticsearch for the data record, looking for the record in question (dataRecordSetId: 35123):

      testing in 7.2.x

      1. Create the data definition in my site (siteId: 20124)

      curl -i -X POST \
        http://localhost:8080/o/data-engine/v1.0/sites/20124/data-definitions \
        -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
        -H 'Content-Type: application/json' \
        -d '{
          "dataDefinitionFields": [
              {
                  "customProperties" : {
                    "dataType": "text"
                  },
                  "fieldType": "text",
                  "indexable": true,
                  "indexType": "text",
                  "name": "product"
              }
          ],
          "description": {
                  "en_US": "Description"
          },
          "name": {
                  "en_US": "Order"
          },
          "storageType":"json"
      }'
      

      2. Check the data definition's existence, and identify the data definition's ID

      curl -i -X GET \
        http://localhost:8080/o/data-engine/v1.0/sites/20124/data-definitions \
        -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
        -H 'Content-Type: application/json'
      

      3. Add a record collection to the data definition (dataDefinitionId: 35544), making note of the record collection ID:

      curl -i -X POST \
        http://localhost:8080/o/data-engine/v1.0/data-definitions/34724/data-record-collections \
        -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
        -H 'Content-Type: application/json' \
        -d '{
          "description": {
                  "en_US": "description"
          },
          "name": {
                "en_US": "All Orders"
          }
      }'
      

      4. Verify existence of record collection on site (siteId: 20124)

      curl -i -X GET \
        http://localhost:8080/o/data-engine/v1.0/sites/20124/data-record-collections \
        -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
        -H 'Content-Type: application/json'
      

      5. Add a record to the record collection (dataRecordSetId: 34730)

      curl -i -X POST \
          http://localhost:8080/o/data-engine/v1.0/data-record-collections/34730/data-records \
          -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
          -H 'Content-Type: application/json' \
          -d '{
              "dataRecordValues":
               {
                   "product": "Bicycle"
               }
        }'
      

      6. Check the record and assert that it's present (dataRecordSetId: 34730)

      curl -i -X GET \
          http://localhost:8080/o/data-engine/v1.0/data-record-collections/34730/data-records \
          -H 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0' \
          -H 'Content-Type: application/json'
      

      7. Access elastic search for the data record, looking for the record in question (dataRecordSetId: 34730)

      Expected / actual behavior

      Actual Behavior
      The Elasticsearch record does not contain the reference to the "product" name of "Bicycle" in the record.

      Expected Behavior
      The Elasticseach record should contain the reference to the product name of "Bicycle" in the index.

      Reproduced in
      Liferay DXP 7.2 + DXP-5
      7.2.X Commit: 2e97ef41d1e9c29f99909f07c8eb8e950d2afc3e

       

        Attachments

          Activity

            People

            Assignee:
            chao.wang Chao Wang
            Reporter:
            to.trinh To To Trinh
            Participants of an Issue:
            Recent user:
            Chao Wang
            Engineering Assignee:
            To To Trinh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              47 weeks, 5 days ago

                Packages

                Version Package
                7.2.10 DXP FP8
                7.2.10.3 DXP SP3
                7.2.X