
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
elasticsearch-concise-query
Advanced tools
A highly configurable and syntactically concise Elasticsearch query builder
Elasticsearch Concise Query simplifies the process for querying an Elasticsearch index.
import { buildECQ } from 'elasticsearch-concise-query';
It is also available as a React higher-order component:
import { ECQ } from 'elasticsearch-concise-query';
...
const MyComponent = ({query, results}) => { ... }
export default ECQ(conciseQueries, config)(MyComponent)
See the examples
directory for more detailed example usage.
Using esConnect to access indexed Elasticsearch data for use in an application is as easy as passing a simple, single-depth object with search parameters and an optional configuration object into a function:
buildECQ({
match: { bike_type: 'road' },
range: { price: { lte: 600, gte: 1000 } },
enums: { frame: ['carbon', 'aluminum alloy'] },
multiField: [{ fields: ['description, keywords'], value: 'skinny tires' }]
}, configObj);
buildECQ
returns an Elasticsearch bool query object:
{
"query": {
"bool": {
"should": [
{
"match": {
"bike_type": "road"
}
},
{
"query": {
"range": {
"price": {
"lte": 600,
"gte": 1000
}
}
}
},
{
"query_string": {
"query": "carbon OR aluminum alloy",
"default_field": "frame",
"analyze_wildcard": false,
"fuzziness": 0
}
},
{
"multi_match": {
"query": "skinny tires",
"fields": [
"description, keywords"
]
}
}
],
"minimum_should_match": 4
}
},
"size": 5,
"sort": {
"price": {
"order": "asc"
}
}
}
A configuration object is passed as a second argument to buildECQ
:
KEY | VALUE TYPE | DESCRIPTION |
---|---|---|
index | String | The endpoint to send the query object to. |
[test] | Boolean | Runs esConnect in "test mode" (does not send a network request). |
[size] | Integer | Specify the maximum amount of results to return. Default: 10 |
[required] | Integer | Specify the minimum amount of queries a result should match (all if omitted). |
[sortBy] | String | Sort results by a specific date. |
To use with ElasticSearch's official Javascript client, elasticsearch.js, simply call buildESQuery
as follows in the object given to its search
method:
client.search({
index: 'myindex',
body: buildESQuery(query, config)
});
To use with ReactiveSearch, a React component library, simply pass a function that calls buildESQuery
as follows into the customQuery
prop. For example:
<DataSearch
...
customQuery={() => buildESQuery(query, config)}
/>
FAQs
A highly configurable and syntactically concise Elasticsearch query builder
The npm package elasticsearch-concise-query receives a total of 0 weekly downloads. As such, elasticsearch-concise-query popularity was classified as not popular.
We found that elasticsearch-concise-query demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.