aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/elastic.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua
index d4a5fdf85..c1935b1f0 100644
--- a/src/plugins/lua/elastic.lua
+++ b/src/plugins/lua/elastic.lua
@@ -462,15 +462,21 @@ local function get_general_metadata(task)
r.symbols = task:get_symbols_all()
for _, symbol in ipairs(r.symbols) do
symbol.groups = nil -- we don't need groups array in elastic
- if type(symbol.options) == "table" then
- symbol.options = table.concat(symbol.options, "; ")
+ if type(symbol.score) == 'number' then
+ symbol.score = lua_util.round(symbol.score, 3)
+ end
+ if type(symbol.weight) == 'number' then
+ symbol.weight = lua_util.round(symbol.weight, 3)
+ end
+ if type(symbol.options) == 'table' then
+ symbol.options = table.concat(symbol.options, '; ')
end
end
r.user = user or empty
if user then
- r.direction = "Outbound"
+ r.direction = 'Outbound'
else
- r.direction = "Inbound"
+ r.direction = 'Inbound'
end
r.qid = task:get_queue_id() or empty
r.helo = task:get_helo() or empty