Commit fd94d0d2 authored by lixiaofang's avatar lixiaofang

mapping

parent 6fdcd970
......@@ -57,7 +57,7 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
if hit_item["_source"]["type_flag"] == "hospital":
if lat is not None and lng is not None:
if lat is not None and lng is not None and lat != 0.0 and lng != 0.0:
if hit_item["_source"]["ori_name"] in g_hospital_pos_dict:
distance = point_distance(lng, lat,
g_hospital_pos_dict[hit_item["_source"]["ori_name"]][0],
......
......@@ -2,11 +2,11 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.core.management.base import BaseCommand
import traceback
import logging
from libs.es import ESPerform
from trans2es.type_info import get_type_info_map, TypeInfo
from trans2es.type_info import get_type_info_map
class Command(BaseCommand):
......@@ -30,11 +30,20 @@ class Command(BaseCommand):
)
def handle(self, *args, **options):
try:
if not options['type']:
raise logging.info('type name must be specified')
elif not (options['type'] in [
'suggest',
]):
raise logging.info(
'unknown type name, type must be one of [suggest]')
es_cli = ESPerform.get_cli()
type_name_list = get_type_info_map().keys()
for type_name in type_name_list:
type_name = "suggest"
if len(options["type"]):
if options["type"] == "all" or type_name == options["type"]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment