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

  • 1.0.0
  • 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

yarn add elasticsearch-dsl-types --dev
# or
npm install elasticsearch-dsl-types --save-dev

Examples

Secure queries with DSL.Query:

import * as DSL from 'elasticsearch-dsl';

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:

yarn install

Build and watch:

tsc -w

Run tests:

yarn test

FAQs

Package last updated on 07 Jan 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