{"action":"opened","issue":{"url":"https://api.github.com/repos/YannBrrd/elasticsearch-entity-resolution/issues/16","labels_url":"https://api.github.com/repos/YannBrrd/elasticsearch-entity-resolution/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/YannBrrd/elasticsearch-entity-resolution/issues/16/comments","events_url":"https://api.github.com/repos/YannBrrd/elasticsearch-entity-resolution/issues/16/events","html_url":"https://github.com/YannBrrd/elasticsearch-entity-resolution/issues/16","id":109812156,"number":16,"title":"When a field is null, its value is transformed to 0.0 for a double and 0 for a long instead of the empty string","user":{"login":"iDmple","id":5065505,"avatar_url":"https://avatars.githubusercontent.com/u/5065505?v=3","gravatar_id":"","url":"https://api.github.com/users/iDmple","html_url":"https://github.com/iDmple","followers_url":"https://api.github.com/users/iDmple/followers","following_url":"https://api.github.com/users/iDmple/following{/other_user}","gists_url":"https://api.github.com/users/iDmple/gists{/gist_id}","starred_url":"https://api.github.com/users/iDmple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iDmple/subscriptions","organizations_url":"https://api.github.com/users/iDmple/orgs","repos_url":"https://api.github.com/users/iDmple/repos","events_url":"https://api.github.com/users/iDmple/events{/privacy}","received_events_url":"https://api.github.com/users/iDmple/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-05T14:45:12Z","updated_at":"2015-10-05T14:45:12Z","closed_at":null,"body":"When a field is null, its value is transformed to 0.0 for a double and 0 for a long instead of the empty string. Because of that if I compare a non-null double to null double, it doesn't skip the comparison and I get the LOW probability selected and the record gets a very low score. Same goes for long.\r\n\r\nExample:\r\n\"185.5\" to null compares \"185.5\" to \"0.0\"...\r\n\r\nHere is the problematic code for double:\r\n\r\n        if (field instanceof ScriptDocValues.Doubles) {\r\n                result = Double.toString(((ScriptDocValues.Doubles) field).getValue());\r\n        }\r\n\r\nI replaced it by:\r\n        if (field instanceof ScriptDocValues.Doubles) {\r\n            if(!((ScriptDocValues.Doubles) field).isEmpty()) {\r\n                result = Double.toString(((ScriptDocValues.Doubles) field).getValue());\r\n            } else {\r\n                result = \"\";\r\n            }\r\n        }\r\n\r\nIf I do the same for long, your tests fail and I don't understand why. So this is probably not the right way to fix, but I'm not sure how else I can.\r\n\r\nCan you please advise ASAP?\r\n\r\nBest regards"}}