Comments (4)
Yep, the host objects closely mimic the object that node's http.request accepts as it's argument. I'm surprised that I didn't write docs for those objects; it is on my TODO list now.
In the mean time, here is a detailed list of all the keys you can use to describe a host and their defaults:
var client = new elasticsearch.Client({
hosts: [
{
protocol: 'http',
host: 'localhost', // can also be hostname:
path: '/', // can also be pathname:
port: 9200,
auth: null, // Basic authentication i.e. 'user:password' to compute an Authorization header.
query: null, // query string, or an object which will be serialized to a query string
headers: null // object, this is only supported in node and es.jquery.js, expect full support soon
}
]
});
from elasticsearch-js.
I do understand that instead of trying something like:
host: {
protocol: 'http',
host: 'my.apigee.com',
prefix: 'v1/proxy' // bogus, made up by me
}
I can use http://my.apigee.com/v1/proxy
to get the desired effect today.
I am just curious if it can be done in a cleaner fashion like upstairs as well?
from elasticsearch-js.
Sure thing. Instead of using the prefix:
key, use the path:
key to accomplish this.
from elasticsearch-js.
thanks @spenceralger is there somethign for placing headers as well? where can the docs be updated to reflect path and header configurations?
from elasticsearch-js.
Related Issues (20)
- Support Cloudflare Workers / Vercel Edge Functions HOT 3
- The query attribute on the `EnrichPolicy` should be `QueryDslQueryContainer | QueryDslQueryContainer[]` not `string` HOT 3
- Bulk helper not giving indications on failure when using stream as datasource HOT 1
- Number of open connections spikes when retryable errors occur HOT 4
- Deno: Module '"npm:@elastic/elasticsearch"' has no exported member 'CatIndicesIndicesRecord'. HOT 1
- Internal module error HOT 1
- bulk helper add onSuccess callback HOT 3
- Content-Type header being changed to "text/plain" from "application/json" somewhere in the process of publishing a document to self-hosted Elasticsearch HOT 5
- Global client context not passed to Transport in 7.13.0 HOT 1
- Support for ES|QL HOT 2
- enum and/or type guard for QueryDslTextQueryType HOT 1
- search_after with sort on nested fields HOT 1
- Redaction mechanism transform arrays properties into objects HOT 1
- Nuxt 3 compatibility HOT 1
- Using the `[]` chars for an enrich policy name isn't wrapped correctly on `deletePolicy` method HOT 1
- ProductNotSupportedError: The client noticed that the server is not a supported distribution of Elasticsearch HOT 1
- Add types for plugins HOT 2
- Error parsing undici module in Next.js 14 project HOT 3
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 product-check listeners added HOT 2
- test issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearch-js.