コード例 #1
0
def create_new_relation():
    node_key1 = request.args.get('node_key1', 'event')  # uid,event
    node1_id = request.args.get(
        'node1_id', 'lao-tai-ao-ye-mai-cai-wei-er-zi-mai-fang-1482126431')
    node1_list = node1_id.split(',')
    node1_index_name = request.args.get(
        'node1_index_name', 'event_index')  # node_index event_index
    rel = request.args.get('rel', 'special_event')
    node_key2 = request.args.get('node_key2', 'event')  # event,uid
    node2_id = request.args.get('node2_id', '港澳2台')
    node2_index_name = request.args.get('node2_index_name',
                                        'special_event_index')
    flag = create_node_and_rel(node_key1, node1_list, node1_index_name, rel, \
                                   node_key2, node2_id, node2_index_name)
    return json.dumps(flag)
コード例 #2
0
def create_new_relation():
    node_key1 = request.args.get('node_key1', 'uid')  # uid,event_id
    node1_id = request.args.get('node1_id', '2080114694,1717278902')
    if node1_id == '':
    	return 'must add user'
    node1_list = node1_id.split(',')
    node1_index_name = request.args.get('node1_index_name', 'node_index')  # node_index event_index
    rel = request.args.get('rel', 'group')
    node_key2 = request.args.get('node_key2', 'group')  # event,uid
    node2_name = request.args.get('node2_id', u'媒体test')
    submit_user = request.args.get('submit_user', '*****@*****.**')
    node2_id = node2_name + '_' + submit_user
    node2_index_name = request.args.get('node2_index_name', 'group_index')
    k_label = request.args.get('k_label', '') #split ,
    flag = create_node_and_rel(node_key1, node1_list, node1_index_name, rel, \
                                   node_key2, node2_id, node2_index_name, submit_user, k_label, node2_name)
    return json.dumps(flag)
コード例 #3
0
def create_new_relation():
    node_key1 = request.args.get('node_key1', 'event_id')  # uid,event_id
    node1_id = request.args.get('node1_id', 'te-lang-pu-1480176000,lu-han-1480176000')
    if node1_id == '':
    	return 'must add event'
    node1_list = node1_id.split(',')
    node1_index_name = request.args.get('node1_index_name', 'event_index')  # node_index event_index
    rel = request.args.get('rel', 'special_event')
    node_key2 = request.args.get('node_key2', 'event')  # event,uid
    node2_name = request.args.get('node2_id', u'政治专题RRR')
    submit_user = request.args.get('submit_user', '*****@*****.**')
    node2_id = node2_name + '_' + submit_user
    node2_index_name = request.args.get('node2_index_name', 'special_event_index')
    k_label = request.args.get('k_label', '') #split ,
    flag = create_node_and_rel(node_key1, node1_list, node1_index_name, rel, \
                                   node_key2, node2_id, node2_index_name, submit_user, k_label, node2_name)
    return json.dumps(flag)