Skip to content

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 benwtrent requested a review from droberts195 October 6, 2020 18:16
@benwtrent
Copy link
Member Author

run elasticsearch-ci/packaging-sample-windows

Copy link

@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 <[email protected]>
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