Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elasticsearch-dsl-types

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-dsl-types

Types for Elasticsearch Query DSL

  • 2.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

elasticsearch-dsl

Write type-safe Elasticsearch queries for TypeScript

Installation

npm install elasticsearch-dsl-types --save-dev

Examples

Secure queries with DSL.Query:

import { DSL } from 'elasticsearch-dsl-types';

interface Properties {
    hello: string;
    world: number;
}

const q0: DSL.Term<Properties> = {
    'term': {
        'hello': 'world',
    }
};

const q1: DSL.Query<Properties> = {
    bool: {
        must: q0,
        must_not: [q0, {'term': {'hello': 'world'}}],
    },
}

const q2: DSL.GeoShape<keyof Properties> = {
    'geo_shape': {
        'hello': {
            'shape': { 'type': 'Point' },
            'relation': 'within'
        },
    }
};

const q3: DSL.Bool = {
    'bool': {
        'must': {
            'term': {
                'hello': 'hello',
            },
        },
        'should': [q2, q2],
        'must_not': [
            { 'terms': { 'world': [1, 2, 3] } },
        ]
    },
};

Development

Set up:

npm install

Build and watch:

npx tsc --watch

Run tests:

npm test

FAQs

Package last updated on 21 Aug 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc