Skip to content

Conversation

@smarsching
Copy link
Contributor

The from and to parameters for range queries were deprecated in Elasticsearch 0.90.4, and more than ten years later, they were finally removed in Elasticsearch 9.x. Therefore, the existing code did not work any longer when using modern versions of Elasticsearch.

This is fixed now by using the gte and lte parameters instead of from and to. In addition to that, the code is simplified a bit by directly using the values as-is and telling Elasticsearch about the format instead of converting them in the client code. This is the approach that was already taken by app/eslog/src/main/java/org/phoebus/applications/eslog/archivedjmslog/ElasticsearchModel.java.

Fixes #3632.

Checklist

  • Testing:
    • The feature has automated tests
    • Tests were run
    • If not, explain how you tested your changes

I tested that with the change, the alarm logger service works correctly with Elasticsearch 9.x: The range query is accepted again and the log view in Phoebus shows the expected results.

As we haven’t deployed the save & restore service yet, I wasn’t able to test the changes there, but as they are essentially the same, I find it very likely that they will have the intended effect.

  • Documentation:
    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

The “from” and “to” parameters for range queries were deprecated in
Elasticsearch 0.90.4, and more than ten years later, they were finally
removed in Elasticsearch 9.x.

Therefore, the existing code did not work any longer when using modern
versions of Elasticsearch. As a side effect, using the “gte” and “lte”
parameters simplifiese the code, because we can now simply tell
Elasticsearch that the values represent seconds since epoch instead of
having to convert to milliseconds in the code.

Fixes ControlSystemStudio#3632.
@shroffk shroffk merged commit 1bb0b5c into ControlSystemStudio:master Nov 10, 2025
2 checks passed
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.

Alarm logger search queries fail with Elasticsearch 9.x

2 participants