Elastic index for api searches for movie and show titles moved to ELASTIC_INDEX variable in config
This commit is contained in:
@@ -4,6 +4,7 @@ import config from '@/config.json'
|
|||||||
|
|
||||||
const SEASONED_URL = config.SEASONED_URL
|
const SEASONED_URL = config.SEASONED_URL
|
||||||
const ELASTIC_URL = config.ELASTIC_URL
|
const ELASTIC_URL = config.ELASTIC_URL
|
||||||
|
const ELASTIC_SEARCH_INDEX = config.ELASTIC_INDEX
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// - Move autorization token and errors here?
|
// - Move autorization token and errors here?
|
||||||
@@ -178,7 +179,7 @@ const getEmoji = () => {
|
|||||||
* @returns {object} List of movies and shows matching query
|
* @returns {object} List of movies and shows matching query
|
||||||
*/
|
*/
|
||||||
const elasticSearchMoviesAndShows = (query) => {
|
const elasticSearchMoviesAndShows = (query) => {
|
||||||
const url = path.join(ELASTIC_URL, 'shows,movies/_search')
|
const url = path.join(ELASTIC_URL, ELASTIC_INDEX, '/_search')
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
"sort" : [
|
"sort" : [
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"SEASONED_URL": "http://localhost:31459/api",
|
"SEASONED_URL": "http://localhost:31459/api",
|
||||||
"ELASTIC_URL": "http://localhost:9200"
|
"ELASTIC_URL": "http://localhost:9200",
|
||||||
|
"ELASTIC_INDEX": "shows,movies"
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"SEASONED_URL": "http://localhost:31459/api",
|
"SEASONED_URL": "http://localhost:31459/api",
|
||||||
"ELASTIC_URL": "http://localhost:9200"
|
"ELASTIC_URL": "http://localhost:9200",
|
||||||
|
"ELASTIC_INDEX": "shows,movies"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user