-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
match_all query disappears when typed into Lucene query bar #62194
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
src/plugins/visualizations/server/saved_objects/visualization_migrations.ts
Outdated
Show resolved
Hide resolved
@@ -60,6 +63,7 @@ function migrateIndexPattern(doc) { | |||
|
|||
export const migrations = { | |||
dashboard: { | |||
'6.7.2': migrateMatchAllQuery, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that version '6.7.2' is a correct version, anyway this PR will be delivered only for versions >7.8
so it's not so important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't have saved searches the same problem? They are also using the searchsource json. I'm not sure about the maps app (was it around that early to have this problem as well?)
@flash1293 probably you are right, we should also do it for 'search' saved object type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexwizp I tested this by manually changing the query in the search source json of a saved search to query: { match_all: {} }
and it got migrated fine.
However, I'm wondering about the following case:
- User creates a saved search in 6.6
- User upgrades to 7.4
- The 7.4 migration kicks in doing unrelated stuff
- User upgrades to 7.7
- The
6.7.2
migration won't run anymore because Kibana thinks it has already done this
It looks like we should do your migration in 7.7.0
instead to make sure it runs even if the user had a "broken" saved search in between.
And if we do this, we should probably also consider the following case (not as relevant, because pretty edge-casey):
- User creates a saved search in 6.6
- User upgrades to 7.4 and visits the saved search
- Now a on-the-fly migration will kick in, changing
query: { match_all: {} }
toquery: { query: { match_all: {} }, language: 'lucene' }
(that's themigrateLegacyQuery
function) - User saves the saved search
- User upgrades to 7.7
- This migration will run, but the migration removing match_all won't work because it's only looking for the legacy structure.
In the latter case it might be even fine to keep it because the users saw the strange query and still saved. But the first case should definitely be handled correctly.
@flash1293 This pull request is a revert of one our old issue that was relevant when user migrated from version For me it looks like if user decided to update |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline with @alexwizp, tested and works as intended. LGTM 👍
…62194) * match_all query disappears when typed into Lucene query bar Closes: elastic#52115 * add migrations for searh savedobject type Co-authored-by: Elastic Machine <[email protected]>
…62626) * match_all query disappears when typed into Lucene query bar Closes: #52115 * add migrations for searh savedobject type Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Closes: #52115
This PR reverts #14644 and move that logic into the migration scripts.
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.
Checklist
Delete any items that are not applicable to this PR.
For maintainers