Skip to content

Commit

Permalink
[savedObjects] add experimental filter definition syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Apr 3, 2018
1 parent a4155e4 commit a1b39f6
Show file tree
Hide file tree
Showing 16 changed files with 943 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default {
roots: [
'<rootDir>/src/ui',
'<rootDir>/src/core_plugins',
'<rootDir>/src/server',
'<rootDir>/packages',
],
collectCoverageFrom: [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SavedObjectsClient/experimentalFilter properly converts complex example 1`] = `
Object {
"bool": Object {
"must": Array [
Object {
"bool": Object {
"should": Array [
Object {
"range": Object {
"visualize.stars": Object {
"gt": 3,
"gte": undefined,
"lt": undefined,
"lte": undefined,
},
},
},
Object {
"range": Object {
"dashboard.stars": Object {
"gt": 3,
"gte": undefined,
"lt": undefined,
"lte": undefined,
},
},
},
],
},
},
Object {
"bool": Object {
"should": Array [
Object {
"range": Object {
"visualize.followers": Object {
"gt": undefined,
"gte": undefined,
"lt": undefined,
"lte": 5,
},
},
},
Object {
"range": Object {
"dashboard.followers": Object {
"gt": undefined,
"gte": undefined,
"lt": undefined,
"lte": 5,
},
},
},
],
},
},
Object {
"bool": Object {
"should": Array [
Object {
"range": Object {
"visualize.created": Object {
"gt": undefined,
"gte": 2018-03-02T07:00:00.000Z,
"lt": 2018-03-03T07:00:00.000Z,
"lte": undefined,
},
},
},
Object {
"range": Object {
"dashboard.created": Object {
"gt": undefined,
"gte": 2018-03-02T07:00:00.000Z,
"lt": 2018-03-03T07:00:00.000Z,
"lte": undefined,
},
},
},
],
},
},
Object {
"bool": Object {
"should": Array [
Object {
"range": Object {
"visualize.created": Object {
"gt": undefined,
"gte": 2018-02-25T07:00:00.000Z,
"lt": 2018-03-01T07:00:00.000Z,
"lte": undefined,
},
},
},
Object {
"range": Object {
"dashboard.created": Object {
"gt": undefined,
"gte": 2018-02-25T07:00:00.000Z,
"lt": 2018-03-01T07:00:00.000Z,
"lte": undefined,
},
},
},
],
},
},
Object {
"bool": Object {
"should": Array [
Object {
"range": Object {
"visualize.created": Object {
"gt": undefined,
"gte": undefined,
"lt": 2012-01-01T07:00:00.000Z,
"lte": undefined,
},
},
},
Object {
"range": Object {
"dashboard.created": Object {
"gt": undefined,
"gte": undefined,
"lt": 2012-01-01T07:00:00.000Z,
"lte": undefined,
},
},
},
],
},
},
Object {
"multi_match": Object {
"fields": undefined,
"query": "dashboard",
"type": "phrase",
},
},
Object {
"multi_match": Object {
"fields": Array [
"visualize.active",
"dashboard.active",
],
"query": true,
"type": "phrase",
},
},
Object {
"bool": Object {
"must": Array [],
"must_not": Array [],
"should": Array [
Object {
"bool": Object {
"should": Array [
Object {
"range": Object {
"visualize.created": Object {
"gt": undefined,
"gte": 2018-03-02T07:00:00.000Z,
"lt": 2018-03-03T07:00:00.000Z,
"lte": undefined,
},
},
},
Object {
"range": Object {
"dashboard.created": Object {
"gt": undefined,
"gte": 2018-03-02T07:00:00.000Z,
"lt": 2018-03-03T07:00:00.000Z,
"lte": undefined,
},
},
},
],
},
},
Object {
"bool": Object {
"should": Array [
Object {
"range": Object {
"visualize.created": Object {
"gt": undefined,
"gte": 2018-03-01T07:00:00.000Z,
"lt": 2018-03-02T07:00:00.000Z,
"lte": undefined,
},
},
},
Object {
"range": Object {
"dashboard.created": Object {
"gt": undefined,
"gte": 2018-03-01T07:00:00.000Z,
"lt": 2018-03-02T07:00:00.000Z,
"lte": undefined,
},
},
},
],
},
},
],
},
},
],
"must_not": Array [
Object {
"multi_match": Object {
"fields": Array [
"visualize.status",
"dashboard.status",
],
"query": "open",
"type": "phrase",
},
},
Object {
"multi_match": Object {
"fields": Array [
"visualize.owner",
"dashboard.owner",
],
"query": "dewey",
"type": "phrase",
},
},
Object {
"bool": Object {
"must": Array [],
"must_not": Array [],
"should": Array [
Object {
"multi_match": Object {
"fields": Array [
"visualize.tag",
"dashboard.tag",
],
"query": "finance",
"type": "phrase",
},
},
Object {
"multi_match": Object {
"fields": Array [
"visualize.tag",
"dashboard.tag",
],
"query": "eng",
"type": "phrase",
},
},
Object {
"multi_match": Object {
"fields": Array [
"visualize.tag",
"dashboard.tag",
],
"query": "ga",
"type": "phrase",
},
},
],
},
},
],
"should": Array [],
},
}
`;
Loading

0 comments on commit a1b39f6

Please sign in to comment.