Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-31527

Fix Elasticsearch/Opensearch unit test errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2023.0, 2021.31
    • Component/s: Elasticsearch

      Description

      Since a recent commit on Nuxeo 2021 & 2023 the test execution order has changed, leading to issue such as:

      2022-12-13 11:42:44,401 [http-nio-40629-exec-2] ERROR [WebEngineExceptionMapper] org.nuxeo.ecm.core.api.NuxeoException: OpenSearchStatusException[OpenSearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: OpenSearchException[OpenSearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [dc:title] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]]; nested: OpenSearchException[OpenSearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [dc:title] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]];
      org.nuxeo.ecm.core.api.NuxeoException: OpenSearchStatusException[OpenSearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: OpenSearchException[OpenSearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [dc:title] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]]; nested: OpenSearchException[OpenSearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [dc:title] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]];
      

      This is due to the fact that TestAppendCustomMapping is now running before RestESDocumentsTest and AutomationESDocumentsTest, and it left a wrong mapping in place.
      This issue is not visible when running tests on the embedded node because it is restarted between tests.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: