curl -X DELETE "localhost:9200/systems_test"
echo
curl -X PUT "localhost:9200/systems_test" -H 'Content-Type: application/json' -d '{
"settings":{"index":{"number_of_shards":"1","store":{"preload":["dvd","tim"]},"analysis":{"filter":{"autocomplete_filter":{"type":"edge_ngram","min_gram":"1","max_gram":"20"}},"normalizer":{"lowercase":{"filter":["lowercase"],"type":"custom"}},"analyzer":{"autocomplete":{"filter":["lowercase","autocomplete_filter"],"type":"custom","tokenizer":"standard"}}},"number_of_replicas":"1"}}
}'
echo
curl -X PUT "localhost:9200/systems_test/_mapping" -H 'Content-Type: application/json' -d '{
"properties":{"allegiance":{"type":"text","fields":{"keyword":{"type":"keyword","eager_global_ordinals":true}}},"bodies":{"type":"nested","properties":{"distance_to_arrival":{"type":"double"},"edsm_id":{"type":"keyword"},"estimated_mapping_value":{"type":"long"},"estimated_scan_value":{"type":"long"},"id":{"type":"keyword"},"id64":{"type":"keyword"},"is_main_star":{"type":"boolean"},"name":{"type":"text","fields":{"keyword":{"type":"keyword"},"suggest":{"type":"text","analyzer":"autocomplete","search_analyzer":"standard"}}},"subtype":{"type":"text","fields":{"keyword":{"type":"keyword"}}},"terraforming_state":{"type":"text","fields":{"keyword":{"type":"keyword"}}},"type":{"type":"text","fields":{"keyword":{"type":"keyword"}}}}},"controlling_minor_faction":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"edsm_id":{"type":"long"},"estimated_scan_value":{"type":"long"},"government":{"type":"text","fields":{"keyword":{"type":"keyword","eager_global_ordinals":true}}},"id":{"type":"keyword"},"id64":{"type":"keyword"},"minor_faction_presence":{"properties":{"influence":{"type":"float"},"name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"state":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},"minor_faction_presences":{"type":"nested","properties":{"influence":{"type":"double"},"name":{"type":"text","fields":{"keyword":{"type":"keyword"}}},"state":{"type":"text","fields":{"keyword":{"type":"keyword"}}}}},"name":{"type":"text","fields":{"keyword":{"type":"keyword"},"lkeyword":{"type":"keyword","normalizer":"lowercase"},"suggest":{"type":"text","analyzer":"autocomplete","search_analyzer":"standard"}}},"needs_permit":{"type":"boolean"},"population":{"type":"long"},"power":{"type":"text","fields":{"keyword":{"type":"keyword","eager_global_ordinals":true}}},"power_state":{"type":"text","fields":{"keyword":{"type":"keyword","eager_global_ordinals":true}}},"primary_economy":{"type":"text","fields":{"keyword":{"type":"keyword","eager_global_ordinals":true}}},"secondary_economy":{"type":"text","fields":{"keyword":{"type":"keyword","eager_global_ordinals":true}}},"security":{"type":"text","fields":{"keyword":{"type":"keyword","eager_global_ordinals":true}}},"state":{"type":"text","fields":{"keyword":{"type":"keyword","eager_global_ordinals":true}}},"x":{"type":"double"},"y":{"type":"double"},"z":{"type":"double"}}
}'
echo
curl -X POST "localhost:9200/systems_test/_doc" -H 'Content-Type: application/json' -d '{
"population" : 0,
"z" : -31.84375,
"needs_permit" : false,
"y" : 6.5625,
"bodies" : [
{
"edsm_id" : 21273560,
"id64" : 21273560,
"name" : "Wregoe DI-O b47-12 11",
"id" : 21273560,
"distance_to_arrival" : 1728,
"is_main_star" : false,
"estimated_scan_value" : 500,
"estimated_mapping_value" : 1666,
"subtype" : "Icy body",
"type" : "Planet"
}
],
"id64" : 27067823498649,
"edsm_id" : 8081851,
"x" : 641.90625,
"name" : "Wregoe DI-O b47-12"
}'
echo
curl -X POST "localhost:9200/systems_test/_doc" -H 'Content-Type: application/json' -d '{
"edsm_id" : 8081852,
"id64" : 60818917171114,
"name" : "Boelts QM-Q c19-221",
"x" : -7720,
"y" : -983.625,
"bodies" : [
{
"type" : "Star",
"estimated_scan_value" : 1214,
"estimated_mapping_value" : 4046,
"subtype" : "G (White-Yellow) Star",
"is_main_star" : true,
"name" : "Boelts QM-Q c19-221 A",
"id64" : 14982802,
"edsm_id" : 14982802,
"distance_to_arrival" : 0,
"id" : 14982802
}
],
"z" : 16417.4375,
"needs_permit" : false,
"population" : 0
}'
echo