Skip to content

Elasticsearch integration: every field is sent as String #29

@enoquefcd

Description

@enoquefcd

When moskito-central sends the producers information to elasticSearch (using v5.6.12), every field reaches elasticSearch as a String field, including number and date fields, which makes it basicly useless because kibana can't make any countable visualization over String fields. I don't know if elasticsearch requires us to send the fields with a specified type along with the field, or if its just a case of sending : 123 instead of "123" on the json fields.

EDIT: I just noticed that just sending 123 instead of "123" on the request json to elasticsearch is enough, for a provisory solution, I just edited the ElasticsearchStorage.httpProcessSnapshot() method to convert the stats to Map<String, Object> instead of Map<String, String>, and convert the number strings to bigdecimal,, then the gson.toJson() will convert the types correctly,,, ill try this soon for dates too

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions