
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
contexture-elasticsearch
Advanced tools
Elasticsearch Provider for Contexture
This provider takes a config object as a parameter, and expects a getClient
method to be provided, which should be an instantiated elasticsearch client.
This provider takes a config object as a parameter:
Option | Type | Description | Required |
---|---|---|---|
getClient | function | Returns an instantiated elasticsearch client | x |
request | object | Merged in the json body of every request to elasticsearch (e.g. to add custom headers) | |
types | object | Contexture node types, like all other providers |
Schemas with with an elasticsearch provider can specify any or all of the following properties:
Option | Type | Description | Required |
---|---|---|---|
index | string | Which ES index to use when querying | x |
type | string | Which ES type to use when querying | |
summaryView | function | Used by results to return a summary view instead of the whole document, (e.g. for indexes with many fields). Defaults to returning the hit property. | |
highlight | object | Used by results to determine what fields to highlight, and whether or not they are inline (copied over inline on to the source) or additional (in a list of additional fields that matched) |
module.exports = {
elasticsearch: {
index: 'SomeIndex',
type: 'SomeType'
}
}
let _ = require('lodash')
let Contexture = require('contexture')
let provider = require('contexture-elasticsearch')
let types = require('contexture-elasticsearch/types')
let schemas = require('./path/to/schemas')
let elasticsearch = require('elasticsearch')
let AgentKeepAlive = require('agentkeepalive'),
let process = Contexture({
schemas,
providers: {
elasticsearch: provider({
getClient: _.memoize(() =>
elasticsearch.Client({
// This is an example config, see the elasticsearch js docs for more
minSockets: 1,
maxSockets: 20,
keepAlive: true,
createNodeAgent: (connection, config) =>
new AgentKeepAlive(connection.makeAgentConfig(config))
})
),
request: {
headers: {
'custom-header-app-name': 'my-app-sent-this'
}
},
types: types({
geo: {
geocodeLocation: query =>
googleplaces.textSearch({
query
})
}
})
})
}
})
bool
cardinality
date
dateHistogram
esTwoLevelAggregation
exists
facet
geo
groupedMetric
matchCardinality
matchStats
nLevelAggregation
nonzeroClusters
number
percentileRanks
percentiles
percentilesRange
query
rangeStats
results
smartIntervalHistogram
smartPercentileRanks
statistical
terms
termsDelta
termsStatsHits
terms_stats
text
twoLevelMatch
FAQs
ElasticSearch Provider for Contexture
The npm package contexture-elasticsearch receives a total of 278 weekly downloads. As such, contexture-elasticsearch popularity was classified as not popular.
We found that contexture-elasticsearch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.