{"id":20672448,"url":"https://github.com/zhuliquan/scaled_float","last_synced_at":"2025-03-10T17:57:53.011Z","repository":{"id":61624240,"uuid":"538141125","full_name":"zhuliquan/scaled_float","owner":"zhuliquan","description":"Scaled float field type in ElasticSearch, a floating point number that is backed by a long, scaled by a fixed double scaling factor.","archived":false,"fork":false,"pushed_at":"2022-09-18T15:16:33.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T14:15:15.869Z","etag":null,"topics":["elasticsearch","es","golang","scaledfloat"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhuliquan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-18T14:48:19.000Z","updated_at":"2022-09-18T16:32:47.000Z","dependencies_parsed_at":"2022-10-18T18:00:21.344Z","dependency_job_id":null,"html_url":"https://github.com/zhuliquan/scaled_float","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuliquan%2Fscaled_float","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuliquan%2Fscaled_float/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuliquan%2Fscaled_float/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuliquan%2Fscaled_float/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhuliquan","download_url":"https://codeload.github.com/zhuliquan/scaled_float/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242899997,"owners_count":20203704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","es","golang","scaledfloat"],"created_at":"2024-11-16T20:37:33.480Z","updated_at":"2025-03-10T17:57:52.989Z","avatar_url":"https://github.com/zhuliquan.png","language":"Go","readme":"# Description\r\nScaled float field type in ElasticSearch, a floating point number that is backed by a long, scaled by a fixed double scaling factor.\r\n\r\n# Detail\r\nFor floating-point types, it is often more efficient to store floating-point data into an integer using a scaling factor, which is what the scaled_float type does under the hood. For instance, a price field could be stored in a scaled_float with a scaling_factor of 100. All APIs would work as if the field was stored as a double, but under the hood Elasticsearch would be working with the number of cents, price*100, which is an integer. This is mostly helpful to save disk space since integers are way easier to compress than floating points. scaled_float is also fine to use in order to trade accuracy for disk space. For instance imagine that you are tracking cpu utilization as a number between 0 and 1. It usually does not matter much whether cpu utilization is 12.7% or 13%, so you could use a scaled_float with a scaling_factor of 100 in order to round cpu utilization to the closest percent in order to save space.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuliquan%2Fscaled_float","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhuliquan%2Fscaled_float","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuliquan%2Fscaled_float/lists"}