Elastic index for api searches for movie and show titles moved to ELASTIC_INDEX variable in config

This commit is contained in:
2019-06-28 17:42:39 +02:00
parent 5825d0e608
commit 8dc51251c1
3 changed files with 7 additions and 4 deletions

View File

@@ -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" : [

View File

@@ -1,4 +1,5 @@
{
"SEASONED_URL": "http://localhost:31459/api",
"ELASTIC_URL": "http://localhost:9200"
}
"ELASTIC_URL": "http://localhost:9200",
"ELASTIC_INDEX": "shows,movies"
}

View File

@@ -1,4 +1,5 @@
{
"SEASONED_URL": "http://localhost:31459/api",
"ELASTIC_URL": "http://localhost:9200"
"ELASTIC_URL": "http://localhost:9200",
"ELASTIC_INDEX": "shows,movies"
}