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

[ML] adding result_type and mlcategory fields to category definitions #63326

Merged
merged 2 commits into from
Oct 7, 2020

Conversation

benwtrent
Copy link
Member

@benwtrent benwtrent commented Oct 6, 2020

To easy correlation between anomaly results and category definitions, this commit adds a new keyword mapped field mlcategory.

This field is always the same as the category_id field (which is mapped as a long). But since anomaly results store
the mlcategory as a keyword, it simplifies queries if category_definitions also had this field as a keyword.

The stored JSON is a string.

Additionally, this commit adds a result_type: category_definition entry to category definition documents.

This will help simplify and unify result queries in the future.

closes #60108

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

@benwtrent
Copy link
Member Author

I opted to not add these fields to the HLRC as they don't seem to add any value there. Especially since result type would just be ignored and mlcategory is simply category_id.

@benwtrent
Copy link
Member Author

run elasticsearch-ci/packaging-sample-windows

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

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

LGTM

I changed the label from >non-issue to >enhancement, as I think some people would find this interesting to know about.

@benwtrent benwtrent merged commit 0fe9787 into elastic:master Oct 7, 2020
@benwtrent benwtrent deleted the feature/ml-category-updates branch October 7, 2020 14:50
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Oct 7, 2020
…elastic#63326)

To easy correlation between anomaly results and category definitions, this commit adds a new keyword mapped field `mlcategory`.

This field is always the same as the `category_id` field (which is mapped as a long). But since anomaly results store
the `mlcategory` as a keyword, it simplifies queries if category_definitions also had this field as a keyword.

The stored JSON is a `string`.

Additionally, this commit adds a `result_type: category_definition` entry to category definition documents.

This will help simplify and unify result queries in the future.

closes elastic#60108
benwtrent added a commit that referenced this pull request Oct 8, 2020
…#63326) (#63412)

To easy correlation between anomaly results and category definitions, this commit adds a new keyword mapped field `mlcategory`.

This field is always the same as the `category_id` field (which is mapped as a long). But since anomaly results store
the `mlcategory` as a keyword, it simplifies queries if category_definitions also had this field as a keyword.

The stored JSON is a `string`.

Additionally, this commit adds a `result_type: category_definition` entry to category definition documents.

This will help simplify and unify result queries in the future.

closes #60108

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add mlcategory and result_type to category definition docs
4 participants