-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make index, type and id optional when creating records. #73
- Loading branch information
Showing
5 changed files
with
64 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = function options(record, method) { | ||
// record.index = record.index || process.env.ES_INDEX || 'index'; | ||
record.index = record.index || process.env.ES_INDEX || 'index'; | ||
var o = { | ||
host: '127.0.0.1', | ||
port: 9200, | ||
|
@@ -9,20 +9,16 @@ module.exports = function options(record, method) { | |
'Content-Type': 'application/json' | ||
} | ||
}; | ||
// example url: https://un:pw@dogwood-1234.eu-west-1.searchly.com | ||
if(process.env.SEARCHBOX_SSL_URL) { | ||
var url = process.env.SEARCHBOX_SSL_URL; | ||
// e.g: "https://un:[email protected]" | ||
var url = process.env.SEARCHBOX_SSL_URL; | ||
var unpw = url.split('://')[1].split(':'); | ||
var un = unpw[0]; | ||
var pw = unpw[1].split('@')[0]; | ||
console.log(un +':'+pw); | ||
var un = unpw[0]; | ||
var pw = unpw[1].split('@')[0]; | ||
var auth = (new Buffer(un + ':' + pw, 'utf8')).toString('base64'); | ||
o.headers['Authorization'] = 'Basic ' + auth; | ||
o.host = url.split('@')[1]; | ||
o.port = 443; | ||
o.host = url.split('@')[1]; | ||
o.port = 443; | ||
} | ||
// console.log(' - - - - - - - - - - - - - - options:') | ||
// console.log(o); | ||
// console.log(' - - - - - - - - - - - - - - - - - - -') | ||
return o; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters