feat: index location as raw numbers

This commit is contained in:
2018-11-02 12:29:57 -07:00
parent 20bb9460d1
commit 98e54c89d9
2 changed files with 4 additions and 0 deletions

View File

@@ -29,6 +29,8 @@ export default async function(indexName, opts = {}) {
time_position: new Date(rec[3] * 1000), time_position: new Date(rec[3] * 1000),
last_contact: new Date(rec[4] * 1000), last_contact: new Date(rec[4] * 1000),
location: rec[5] && rec[6] ? `${rec[6]},${rec[5]}` : null, location: rec[5] && rec[6] ? `${rec[6]},${rec[5]}` : null,
lat: rec[6],
lon: rec[5],
baro_altitude: rec[7], baro_altitude: rec[7],
geo_altitude: rec[13], geo_altitude: rec[13],
on_ground: rec[8], on_ground: rec[8],

View File

@@ -32,6 +32,8 @@ export async function createIndex(client, index) {
time_position: { type: 'date' }, time_position: { type: 'date' },
last_contact: { type: 'date' }, last_contact: { type: 'date' },
location: { type: 'geo_point' }, location: { type: 'geo_point' },
lat: { type: 'float' },
lon: { type: 'float' },
baro_altitude: { type: 'float' }, baro_altitude: { type: 'float' },
geo_altitude: { type: 'float' }, geo_altitude: { type: 'float' },
on_ground: { type: 'boolean' }, on_ground: { type: 'boolean' },