diff --git a/src/api.js b/src/api.js index 1dab1a5..5bea0cd 100644 --- a/src/api.js +++ b/src/api.js @@ -4,6 +4,7 @@ import config from '@/config.json' const SEASONED_URL = config.SEASONED_URL const ELASTIC_URL = config.ELASTIC_URL +const ELASTIC_SEARCH_INDEX = config.ELASTIC_INDEX // TODO // - Move autorization token and errors here? @@ -178,7 +179,7 @@ const getEmoji = () => { * @returns {object} List of movies and shows matching query */ const elasticSearchMoviesAndShows = (query) => { - const url = path.join(ELASTIC_URL, 'shows,movies/_search') + const url = path.join(ELASTIC_URL, ELASTIC_INDEX, '/_search') const body = { "sort" : [ diff --git a/src/config.json b/src/config.json index 7c7e3fa..293174d 100644 --- a/src/config.json +++ b/src/config.json @@ -1,4 +1,5 @@ { "SEASONED_URL": "http://localhost:31459/api", - "ELASTIC_URL": "http://localhost:9200" -} \ No newline at end of file + "ELASTIC_URL": "http://localhost:9200", + "ELASTIC_INDEX": "shows,movies" +} diff --git a/src/config.json.example b/src/config.json.example index c11c318..293174d 100644 --- a/src/config.json.example +++ b/src/config.json.example @@ -1,4 +1,5 @@ { "SEASONED_URL": "http://localhost:31459/api", - "ELASTIC_URL": "http://localhost:9200" + "ELASTIC_URL": "http://localhost:9200", + "ELASTIC_INDEX": "shows,movies" }