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

Add autocomplete suggestions for dense_vector type #190769

Merged

Conversation

sakurai-youhei
Copy link
Member

@sakurai-youhei sakurai-youhei commented Aug 20, 2024

Summary

This PR adds autocomplete for dense_vector type.

With console.dev.enableMonaco: false:
pr-for-vector

With console.dev.enableMonaco: true:
pr-for-vector-monaco

Closes #190763

For maintainers

Release note

Improves autocomplete to suggest fields for dense_vector type

@sakurai-youhei sakurai-youhei added release_note:enhancement Feature:Console Dev Tools Console Feature Feature:Dev Tools enhancement New value added to drive a business result labels Aug 20, 2024
@sakurai-youhei sakurai-youhei requested a review from a team as a code owner August 20, 2024 08:45
__one_of: [
'',
// text-based types
{ __one_of: ['positions', 'docs', 'freqs', 'offsets'] },
Copy link
Member Author

@sakurai-youhei sakurai-youhei Aug 20, 2024

Choose a reason for hiding this comment

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

positions is default in 8.x - adjusted according to https://www.elastic.co/guide/en/elasticsearch/reference/8.15/index-options.html

__one_of: [
'',
// text-based types
{ __one_of: ['BM25', 'boolean'] },
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, I think all options can be added in one array, they are displayed all together anyways

@yuliacech yuliacech self-requested a review August 20, 2024 13:52
@@ -84,7 +85,20 @@ export const mappings = (specService: SpecDefinitionsService) => {
// index_prefixes: { min_chars, max_chars },

index_options: {
__one_of: ['docs', 'freqs', 'positions'],
__one_of: [
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the autocomplete could work with the object just added among the string options, wdyt?

            __one_of: [
           'positions', 
           'docs', 
            'freqs', 
            'offsets',
            { 
              type: 
             ...
             }
           ]

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for this point. Yes, that's better, so I flattened the unnecessary nests of __one_of.

Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Thanks a lot for adding these definitions, @sakurai-youhei! I think it looks great, we could just simplify the changes in some places. Let me know what you think

@pquentin pquentin added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v9.0.0 v8.16.0 labels Sep 19, 2024
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #9 / SuggestUsersPopover calls onUsersChange when 1 user is selected

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @sakurai-youhei! Latest changes LGTM 👍

@sakurai-youhei sakurai-youhei merged commit 9cfd409 into elastic:main Sep 20, 2024
22 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 20, 2024
This PR adds autocomplete for `dense_vector` type.

Closes elastic#190763

---------

Co-authored-by: Quentin Pradet <[email protected]>
(cherry picked from commit 9cfd409)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 20, 2024
…193570)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Add autocomplete suggestions for dense_vector type
(#190769)](#190769)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Youhei
Sakurai","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-20T13:04:30Z","message":"Add
autocomplete suggestions for dense_vector type (#190769)\n\nThis PR adds
autocomplete for `dense_vector` type.\r\n\r\nCloses
https://github.com/elastic/kibana/issues/190763\r\n\r\n---------\r\n\r\nCo-authored-by:
Quentin Pradet
<[email protected]>","sha":"9cfd40937522276d0d78c5aae2bd5142623d8c91","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Feature:Console","Feature:Dev
Tools","enhancement","v9.0.0","backport:prev-minor","v8.16.0"],"title":"Add
autocomplete suggestions for dense_vector
type","number":190769,"url":"https://github.com/elastic/kibana/pull/190769","mergeCommit":{"message":"Add
autocomplete suggestions for dense_vector type (#190769)\n\nThis PR adds
autocomplete for `dense_vector` type.\r\n\r\nCloses
https://github.com/elastic/kibana/issues/190763\r\n\r\n---------\r\n\r\nCo-authored-by:
Quentin Pradet
<[email protected]>","sha":"9cfd40937522276d0d78c5aae2bd5142623d8c91"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/190769","number":190769,"mergeCommit":{"message":"Add
autocomplete suggestions for dense_vector type (#190769)\n\nThis PR adds
autocomplete for `dense_vector` type.\r\n\r\nCloses
https://github.com/elastic/kibana/issues/190763\r\n\r\n---------\r\n\r\nCo-authored-by:
Quentin Pradet
<[email protected]>","sha":"9cfd40937522276d0d78c5aae2bd5142623d8c91"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Youhei Sakurai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) enhancement New value added to drive a business result Feature:Console Dev Tools Console Feature Feature:Dev Tools release_note:enhancement v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Console: Add autocomplete suggestions for dense_vector type
5 participants