Socket
Socket
Sign inDemoInstall

elastic-dsl-typescript

Package Overview
Dependencies
0
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.6 to 1.0.7

8

Builders/Aggregation/index.js

@@ -27,5 +27,5 @@ "use strict";

[`${name}_filtered`]: {
[aggType]: Object.assign(Object.assign({}, all), (d.opts || {})),
},
},
[aggType]: Object.assign(Object.assign({}, all), (d.opts || {}))
}
}
};

@@ -35,3 +35,3 @@ return this;

this._data[name] = {
[aggType]: Object.assign(Object.assign({}, d.params), (d.opts || {})),
[aggType]: Object.assign(Object.assign({}, d.params), (d.opts || {}))
};

@@ -38,0 +38,0 @@ return this;

@@ -1,2 +0,2 @@

import { AggSchema } from 'Abstract/Schema';
import { AggSchema } from '../../Abstract/Schema';
import { RangeAggregation, PainLessScript } from '../../Types';

@@ -3,0 +3,0 @@ export interface AggregationSchema extends AggSchema {

@@ -1,2 +0,2 @@

import { ScoreMode } from 'Types';
import { ScoreMode } from '../../Types';
/**

@@ -3,0 +3,0 @@ * Base nested query

{
"name": "elastic-dsl-typescript",
"version": "1.0.6",
"version": "1.0.7",
"description": "Node.js ElasticSearch search query builder",

@@ -5,0 +5,0 @@ "main": "./",

@@ -5,3 +5,3 @@ import { AggregationSchema } from '..';

import { Sort, Range } from '../Types';
import { Aggregation } from 'Builders/Aggregation';
import { Aggregation } from '../Builders/Aggregation';
/**

@@ -8,0 +8,0 @@ *

@@ -11,8 +11,8 @@ import { Aggregation } from '../../Builders/Aggregation';

params: {
field: 'price',
field: "price",
script: {
params: {},
source: 'doc.my_avg.value * 2',
},
},
source: "doc.my_avg.value * 2"
}
}
});

@@ -23,9 +23,9 @@

avg: {
field: 'price',
field: "price",
script: {
params: {},
source: 'doc.my_avg.value * 2',
},
},
},
source: "doc.my_avg.value * 2"
}
}
}
});

@@ -37,19 +37,19 @@ });

params: {
field: 'price',
field: "price",
script: {
params: {},
source: 'doc.my_max.value * 2',
},
},
source: "doc.my_max.value * 2"
}
}
})
.add('min', 'my_min', {
params: {
field: 'price',
field: "price",
script: {
params: {},
source: 'doc.my_min.value * 2',
},
},
source: "doc.my_min.value * 2"
}
}
});

@@ -60,18 +60,18 @@

max: {
field: 'price',
field: "price",
script: {
params: {},
source: 'doc.my_max.value * 2',
},
},
source: "doc.my_max.value * 2"
}
}
},
my_min: {
min: {
field: 'price',
field: "price",
script: {
params: {},
source: 'doc.my_min.value * 2',
},
},
},
source: "doc.my_min.value * 2"
}
}
}
});

@@ -83,10 +83,10 @@ });

params: {
field: 'color',
field: "color"
},
opts: {
exclude: ['red'],
include: ['black', 'green'],
exclude: ["red"],
include: ["black", "green"],
min_doc_count: 2,
size: 100,
},
size: 100
}
});

@@ -97,9 +97,9 @@

terms: {
exclude: ['red'],
field: 'color',
include: ['black', 'green'],
exclude: ["red"],
field: "color",
include: ["black", "green"],
min_doc_count: 2,
size: 100,
},
},
size: 100
}
}
});

@@ -111,12 +111,12 @@ });

params: {
field: 'price',
field: "price",
ranges: [
{
from: 100,
from: 100
},
{
to: 1000,
},
],
},
to: 1000
}
]
}
});

@@ -127,13 +127,13 @@

range: {
field: 'price',
field: "price",
ranges: [
{
from: 100,
from: 100
},
{
to: 1000,
},
],
},
},
to: 1000
}
]
}
}
});

@@ -147,12 +147,12 @@ });

params: {
field: 'price',
field: "price",
ranges: [
{
from: 100,
from: 100
},
{
to: 1000,
},
],
},
to: 1000
}
]
}
});

@@ -163,11 +163,11 @@

test('Create filtered terms agg', async () => {
const a = new Aggregation().add('terms', 'availStoreSizes', {
test("Create filtered terms agg", async () => {
const a = new Aggregation().add("terms", "availStoreSizes", {
params: {
field: 'availSizes.sizes.keyword',
filter: { terms: { 'availSizes.IStoreId.keyword': ['0000'] } },
field: "availSizes.sizes.keyword",
filter: { terms: { "availSizes.IStoreId.keyword": ["0000"] } }
},
opts: {
size: 50,
},
size: 50
}
});

@@ -181,7 +181,7 @@ // availStoreSizes: {

availStoreSizes: {
aggs: { availStoreSizes_filtered: { terms: { field: 'availSizes.sizes.keyword', size: 50 } } },
filter: { terms: { 'availSizes.IStoreId.keyword': ['0000'] } },
},
aggs: { availStoreSizes_filtered: { terms: { field: "availSizes.sizes.keyword", size: 50 } } },
filter: { terms: { "availSizes.IStoreId.keyword": ["0000"] } }
}
});
});
});

@@ -21,4 +21,4 @@ import { Bool } from '../../Builders/Bool';

expect(b.build()).toHaveProperty(
'bool',
expect.objectContaining({"must": [{"term": {"articul": "00001851", "boost": 1}}]}),
"bool",
expect.objectContaining({ "must": [{ "term": { "articul": "00001851", "boost": 1 } }] })
);

@@ -201,3 +201,3 @@ });

term: {
test: "11"
test: "11"

@@ -210,3 +210,3 @@ }

term: {
test: "11"
test: "11"

@@ -213,0 +213,0 @@ }

@@ -68,3 +68,3 @@ import { Aggregation, Bool, Query } from '../../index';

term: {
articul: '111',
articul: "111"

@@ -71,0 +71,0 @@ },

@@ -10,13 +10,13 @@ import { TEXT } from '../../Builders/Text';

params: {
query: 'search text',
query: "search text"
},
opts: {
max_expansions: 1,
analyzer: 'russian',
analyzer: "russian",
auto_generate_synonyms_phrase_query: true,
fuzziness: '6',
operator: 'AND',
fuzziness: "6",
operator: "AND",
prefix_length: 15,
fuzzy_transpositions: true,
},
fuzzy_transpositions: true
}
})

@@ -27,17 +27,17 @@

expect(t).toHaveProperty(
'match',
"match",
expect.objectContaining({
testField: {
analyzer: 'russian',
analyzer: "russian",
auto_generate_synonyms_phrase_query: true,
fuzziness: '6',
fuzziness: "6",
fuzzy_transpositions: true,
max_expansions: 1,
operator: 'AND',
operator: "AND",
prefix_length: 15,
query: 'search text',
},
}),
query: "search text"
}
})
);
});
});

@@ -14,5 +14,5 @@ import { AbstractBulder } from '../../Abstract/AbstractBuilder';

[`${name}_filtered`]: {
[aggType]: { ...(all as object), ...((d.opts as object) || {}) },
},
},
[aggType]: { ...(all as object), ...((d.opts as object) || {}) }
}
}
};

@@ -23,3 +23,3 @@ return this;

this._data[name] = {
[aggType]: { ...(d.params as object), ...((d.opts as object) || {}) },
[aggType]: { ...(d.params as object), ...((d.opts as object) || {}) }
};

@@ -26,0 +26,0 @@ return this;

@@ -1,2 +0,2 @@

import { AggSchema } from 'Abstract/Schema';
import { AggSchema } from '../../Abstract/Schema';
import { Range, RangeAggregation, PainLessScript } from '../../Types';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

import { ScoreMode } from 'Types';
import { ScoreMode } from '../../Types';

@@ -3,0 +3,0 @@ /**

@@ -5,3 +5,3 @@ import { AggregationSchema } from '..';

import { Sort, Range } from '../Types';
import { Aggregation } from 'Builders/Aggregation';
import { Aggregation } from '../Builders/Aggregation';

@@ -8,0 +8,0 @@ /**

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc