(send_data) Fix data file names
This commit is contained in:
@@ -53,7 +53,7 @@ def put_mapping(index_name, mapping_file, quiet=False):
|
|||||||
print("Put '{}' mapping file...".format(mapping_file.name))
|
print("Put '{}' mapping file...".format(mapping_file.name))
|
||||||
res = requests.put(url=ELASTICSEARCH_URL + index_name,
|
res = requests.put(url=ELASTICSEARCH_URL + index_name,
|
||||||
data=mapping_file,
|
data=mapping_file,
|
||||||
headers={'Content-Type': 'application/x-ndjson'})
|
headers={'Content-Type': 'application/json'})
|
||||||
if res.status_code != 200:
|
if res.status_code != 200:
|
||||||
print("An error occured")
|
print("An error occured")
|
||||||
print(res.text)
|
print(res.text)
|
||||||
@@ -69,9 +69,9 @@ ELASTICSEARCH_URL = 'http://localhost:9200/'
|
|||||||
INDEX_NAME = "itunessongs"
|
INDEX_NAME = "itunessongs"
|
||||||
|
|
||||||
# Default file names
|
# Default file names
|
||||||
DEFAULT_SONG_FILE = 'es-music-data.json'
|
DEFAULT_SONG_FILE = 'es-songs.json'
|
||||||
DEFAULT_ALBUM_FILE = 'es-albums-data.json'
|
DEFAULT_ALBUM_FILE = 'es-albums.json'
|
||||||
DEFAULT_ARTIST_FILE = 'es-artist-data.json'
|
DEFAULT_ARTIST_FILE = 'es-artists.json'
|
||||||
DEFAULT_MAPPING_FILE = 'mapping.json'
|
DEFAULT_MAPPING_FILE = 'mapping.json'
|
||||||
|
|
||||||
# Get options
|
# Get options
|
||||||
@@ -117,6 +117,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# Overloaded setting value
|
# Overloaded setting value
|
||||||
INDEX_NAME = args.index_name
|
INDEX_NAME = args.index_name
|
||||||
|
# TODO Critical: index in in the file!
|
||||||
ELASTICSEARCH_URL = args.elasticsearch_url
|
ELASTICSEARCH_URL = args.elasticsearch_url
|
||||||
|
|
||||||
if not args.quiet:
|
if not args.quiet:
|
||||||
|
|||||||
Reference in New Issue
Block a user