Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Updates confidence mapping from Integer to Float #293

Merged
merged 2 commits into from
Sep 24, 2020
Merged

Updates confidence mapping from Integer to Float #293

merged 2 commits into from
Sep 24, 2020

Conversation

mdavis332
Copy link
Collaborator

Float values (like 7.5 or 8.5) get stored in the Integer-mapped confidence field due to coercion [1], but when querying ES (as in a range query), the value is truncated/rounded [2]. E.g., if an indicator's conf is stored as 7.5, but you later query for indicators at 7.5, that indicator won't be returned b/c ES truncates the field value before querying to comply with the Integer mapping type.
Fix this problem by remapping as Float.
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/coerce.html
[2]: elastic/elasticsearch#25861 (comment)

mdavis332 and others added 2 commits September 24, 2020 11:15
Float values (like 7.5 or 8.5) get stored in the Integer-mapped confidence field due to coercion [1], but when querying ES (as in a range query), the value is truncated/rounded [2]. E.g., if an indicator's conf is stored as 7.5, but you later query for indicators at 7.5, that indicator won't be returned b/c ES truncates the field value before querying to comply with the Integer mapping type. 
Fix this problem by remapping as Float.
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/coerce.html
[2]: elastic/elasticsearch#25861 (comment)
@wesyoung wesyoung merged commit c7c3f29 into csirtgadgets:master Sep 24, 2020
@mdavis332 mdavis332 deleted the fix/confidence_to_float branch September 24, 2020 17:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants