Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve export #316

Merged
merged 8 commits into from
Aug 31, 2023
Merged

feat: improve export #316

merged 8 commits into from
Aug 31, 2023

Conversation

sebtiz13
Copy link
Member

@sebtiz13 sebtiz13 commented Aug 30, 2023

What does this PR do ?

  • Add support for elasticsearch and koncorde language for export
  • Improve handle error on export, return error message instead white page
  • Limit export to 10k documents (prevent segfault with more than 25k results)
  • Prevent error duplicate result on search with sort

@sebtiz13 sebtiz13 self-assigned this Aug 30, 2023
const {
query,
sort,
lang = "elasticsearch",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lang was set to koncorde by default before, we should keep the same otherwise it's a breaking change

Copy link
Member Author

@sebtiz13 sebtiz13 Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true, but all other requests use lang='elasticsearch' by default, so it's inconsistent.
But need to be confirmed because for measure export some filters are hard-coded in koncorde language.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it already default to elasticsearch ? See this


return new HttpStream(stream);
} catch (error) {
request.response.configure({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why adding this instead of throwing a traditional error ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this endpoint is mostly called by browser and traditional error return a JSON that can be hard to understand for user.
Maybe the better solution could be to improve global error handler in the core

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment to explain this in the code :)

@sebtiz13 sebtiz13 merged commit e4e746e into 2-dev Aug 31, 2023
@sebtiz13 sebtiz13 deleted the fix/digitaltwin-export branch August 31, 2023 14:31
github-actions bot pushed a commit that referenced this pull request Aug 31, 2023
# [2.4.0-beta.1](v2.3.2...v2.4.0-beta.1) (2023-08-31)

### Bug Fixes

* copy-version script ([72b5e49](72b5e49))

### Features

* digitaltwin exports ([#315](#315)) ([aab65af](aab65af))
* improve export ([#316](#316)) ([e4e746e](e4e746e))
* **measures:** add lastMeasuredAt on DigitalTwin ([#314](#314)) ([05b8a53](05b8a53))
github-actions bot pushed a commit that referenced this pull request Aug 31, 2023
# [2.4.0-beta.1](v2.3.2...v2.4.0-beta.1) (2023-08-31)

### Bug Fixes

* copy-version script ([72b5e49](72b5e49))

### Features

* digitaltwin exports ([#315](#315)) ([aab65af](aab65af))
* improve export ([#316](#316)) ([e4e746e](e4e746e))
* **measures:** add lastMeasuredAt on DigitalTwin ([#314](#314)) ([05b8a53](05b8a53))
sebtiz13 added a commit that referenced this pull request Aug 31, 2023
* feat(export): add support elasticsearch lang
* feat: improve handle error
* feat(export): limit export to 10k documents
  prevent segfault with more than 25k results
* fix(export): prevent error duplicate result
github-actions bot pushed a commit that referenced this pull request Aug 31, 2023
# [2.4.0-beta.1](v2.3.2...v2.4.0-beta.1) (2023-08-31)

### Bug Fixes

* copy-version script ([72b5e49](72b5e49))

### Features

* digitaltwin exports ([#315](#315)) ([aab65af](aab65af))
* improve export ([#316](#316)) ([51db84a](51db84a))
* **measures:** add lastMeasuredAt on DigitalTwin ([#314](#314)) ([05b8a53](05b8a53))
github-actions bot pushed a commit that referenced this pull request Aug 31, 2023
# [2.4.0-beta.1](v2.3.2...v2.4.0-beta.1) (2023-08-31)

### Bug Fixes

* copy-version script ([72b5e49](72b5e49))

### Features

* digitaltwin exports ([#315](#315)) ([aab65af](aab65af))
* improve export ([#316](#316)) ([51db84a](51db84a))
* **measures:** add lastMeasuredAt on DigitalTwin ([#314](#314)) ([05b8a53](05b8a53))
github-actions bot pushed a commit that referenced this pull request Aug 31, 2023
# [2.4.0-beta.1](v2.3.2...v2.4.0-beta.1) (2023-08-31)

### Bug Fixes

* copy-version script ([72b5e49](72b5e49))

### Features

* digitaltwin exports ([#315](#315)) ([aab65af](aab65af))
* improve export ([#316](#316)) ([51db84a](51db84a))
* **measures:** add lastMeasuredAt on DigitalTwin ([#314](#314)) ([05b8a53](05b8a53))
github-actions bot pushed a commit that referenced this pull request Sep 5, 2023
# [2.4.0-beta.2](v2.4.0-beta.1...v2.4.0-beta.2) (2023-09-05)

### Bug Fixes

* copy-version script ([72b5e49](72b5e49))

### Features

* improve export ([#316](#316)) ([51db84a](51db84a))
github-actions bot pushed a commit that referenced this pull request Jan 11, 2024
# [2.4.0-temp-ci-debug.1](v2.3.2...v2.4.0-temp-ci-debug.1) (2024-01-11)

### Bug Fixes

* **asset_migration:** fixes multiple assets migration and optimize ([fd546cf](fd546cf))
* **assetsGroups:** disable checkRights on impersonate ([#325](#325)) ([eaa3edc](eaa3edc))
* **assets:** migrate tenant only if user is admin ([c24f942](c24f942))
* **assetsMigrateTenant:** add type for frontend and fix admin only ([e249f13](e249f13))
* **ci:** correct github token in ci ([a5a6b69](a5a6b69))
* copy-version script ([72b5e49](72b5e49))
* correct KuzzleRequest for pipes ([ef932d1](ef932d1))
* **export:** correct scroll in getNamedMeasures ([05fe4fd](05fe4fd))
* improve get internal devices documents ([03ccb29](03ccb29))
* **migrateTenant:** clear groups of newly created assets ([79f6a5a](79f6a5a))
* **npm:** fix repository url ([514dc59](514dc59))
* update semantic-release ([380c8b3](380c8b3))

### Features

* **asset:** add upsert method ([#323](#323)) ([5f87787](5f87787))
* **assets:** assets migrate tenant ([5f05101](5f05101))
* digitaltwin exports ([#315](#315)) ([aab65af](aab65af))
* **digitalTwin:** allow to modify mapping from application ([#322](#322)) ([89d375a](89d375a))
* **digitalTwin:** implement generic document pipes triggers ([#321](#321)) ([60a21fc](60a21fc))
* improve export ([#316](#316)) ([51db84a](51db84a))
* **measures:** add lastMeasuredAt on DigitalTwin ([#314](#314)) ([05b8a53](05b8a53))
github-actions bot pushed a commit that referenced this pull request Jan 11, 2024
# [2.4.0-temp-ci-debug.1](v2.3.2...v2.4.0-temp-ci-debug.1) (2024-01-11)

### Bug Fixes

* **asset_migration:** fixes multiple assets migration and optimize ([fd546cf](fd546cf))
* **assetsGroups:** disable checkRights on impersonate ([#325](#325)) ([eaa3edc](eaa3edc))
* **assets:** migrate tenant only if user is admin ([c24f942](c24f942))
* **assetsMigrateTenant:** add type for frontend and fix admin only ([e249f13](e249f13))
* **ci:** correct github token in ci ([a5a6b69](a5a6b69))
* copy-version script ([72b5e49](72b5e49))
* correct KuzzleRequest for pipes ([ef932d1](ef932d1))
* **export:** correct scroll in getNamedMeasures ([05fe4fd](05fe4fd))
* improve get internal devices documents ([03ccb29](03ccb29))
* **migrateTenant:** clear groups of newly created assets ([79f6a5a](79f6a5a))
* **npm:** fix repository url ([514dc59](514dc59))
* update semantic-release ([380c8b3](380c8b3))

### Features

* **asset:** add upsert method ([#323](#323)) ([5f87787](5f87787))
* **assets:** assets migrate tenant ([5f05101](5f05101))
* digitaltwin exports ([#315](#315)) ([aab65af](aab65af))
* **digitalTwin:** allow to modify mapping from application ([#322](#322)) ([89d375a](89d375a))
* **digitalTwin:** implement generic document pipes triggers ([#321](#321)) ([60a21fc](60a21fc))
* improve export ([#316](#316)) ([51db84a](51db84a))
* **measures:** add lastMeasuredAt on DigitalTwin ([#314](#314)) ([05b8a53](05b8a53))
github-actions bot pushed a commit that referenced this pull request Jan 11, 2024
# [2.4.0-temp-ci-debug.1](v2.3.2...v2.4.0-temp-ci-debug.1) (2024-01-11)

### Bug Fixes

* **asset_migration:** fixes multiple assets migration and optimize ([fd546cf](fd546cf))
* **assetsGroups:** disable checkRights on impersonate ([#325](#325)) ([eaa3edc](eaa3edc))
* **assets:** migrate tenant only if user is admin ([c24f942](c24f942))
* **assetsMigrateTenant:** add type for frontend and fix admin only ([e249f13](e249f13))
* **ci:** correct github token in ci ([a5a6b69](a5a6b69))
* copy-version script ([72b5e49](72b5e49))
* correct KuzzleRequest for pipes ([ef932d1](ef932d1))
* **export:** correct scroll in getNamedMeasures ([05fe4fd](05fe4fd))
* improve get internal devices documents ([03ccb29](03ccb29))
* **migrateTenant:** clear groups of newly created assets ([79f6a5a](79f6a5a))
* **npm:** fix repository url ([514dc59](514dc59))
* update semantic-release ([380c8b3](380c8b3))

### Features

* **asset:** add upsert method ([#323](#323)) ([5f87787](5f87787))
* **assets:** assets migrate tenant ([5f05101](5f05101))
* digitaltwin exports ([#315](#315)) ([aab65af](aab65af))
* **digitalTwin:** allow to modify mapping from application ([#322](#322)) ([89d375a](89d375a))
* **digitalTwin:** implement generic document pipes triggers ([#321](#321)) ([60a21fc](60a21fc))
* improve export ([#316](#316)) ([51db84a](51db84a))
* **measures:** add lastMeasuredAt on DigitalTwin ([#314](#314)) ([05b8a53](05b8a53))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants