Skip to content

Commit

Permalink
Update Elasticsearch url
Browse files Browse the repository at this point in the history
  • Loading branch information
grimmer0125 committed May 7, 2018
1 parent 92ada24 commit 5780e7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions client/js/api/repos.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ if (window.location.hostname === 'localhost') {
} else if (window.location.hostname === '0.0.0.0') {
baseURL = 'http://localhost:5000';
} else {
baseURL = window.location.protocol + '//' + window.location.hostname;
baseURL = `${window.location.protocol}//${window.location.hostname}`;
}

function getReposStatus() {
const completeURL = baseURL + '/repos';
const completeURL = `${baseURL}/repos`;
// console.log('remote url:', completeURL);
return fetch(completeURL, { credentials: 'include' }).then(res => {

if (res.status === 401) { // statusText === 'Temporary Redirect') {
const location = '/login';// res.headers.get('location');

Expand All @@ -31,7 +30,7 @@ function getReposStatus() {

// can not use .com/ , because the limiation of aws policy
const client = new elasticsearch.Client({
host: 'https://search-searchgithub-7c4xubb6ne3t7keszcai7kqi3m.us-west-2.es.amazonaws.com/githubrepos',
host: 'https://search-search2-rm2lnw4mm2i4oz3ehs3pgpk3o4.us-west-2.es.amazonaws.com/githubrepos',
});

const pageSize = 20;
Expand All @@ -46,7 +45,7 @@ function queryToServer(query, account, page, handler) {
// return a.substr(1, a.length - 2);
}

console.log('final query:' + finalQuery + ';type:' + queryType);
console.log(`final query:${finalQuery};type:${queryType}`);

client.search({
// index: 'githubrepos',
Expand All @@ -63,13 +62,13 @@ function queryToServer(query, account, page, handler) {
from: page * pageSize,
size: pageSize,
},
}).then(function (resp) {
}).then((resp) => {
handler(resp);
// const hits = resp.hits.hits;
// console.log('query result:', hits);
// debugger;
// const ttt = 0;
}, function (err) {
}, (err) => {
console.log('query to elasticsearch error!!!');
console.trace(err.message);
});
Expand Down
3 changes: 2 additions & 1 deletion indexAPI.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (
// }

const (
awsURL = "https://search-searchgithub-7c4xubb6ne3t7keszcai7kqi3m.us-west-2.es.amazonaws.com"
awsURL = "https://search-search2-rm2lnw4mm2i4oz3ehs3pgpk3o4.us-west-2.es.amazonaws.com"

githubIndex = "githubrepos" //can not be githubRepos, should lower case !!
)

Expand Down

0 comments on commit 5780e7b

Please sign in to comment.