@outliant/sunrise-utils 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,9 +4,24 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [1.0.9](https://github.com/outliant/sunrise-utils/compare/1.0.8...1.0.9)
8
+
9
+ - chore: support taskfield group #860pn480e [`9bded12`](https://github.com/outliant/sunrise-utils/commit/9bded1255c994ea01823b1b689aa38d80da76c8a)
10
+
11
+ #### [1.0.8](https://github.com/outliant/sunrise-utils/compare/1.0.7...1.0.8)
12
+
13
+ > 24 March 2023
14
+
15
+ - chore: use match_phrase_prefix [`#3`](https://github.com/outliant/sunrise-utils/pull/3)
16
+ - chore(release): 1.0.8 [`d901d17`](https://github.com/outliant/sunrise-utils/commit/d901d17b78491dfe89c3068dac03579c902590b1)
17
+ - chore(#860q1ku0m): use match_phrase_prefix for fuzzy searching [`f607110`](https://github.com/outliant/sunrise-utils/commit/f607110d9071d02b0aeeb1a41dd0e8ee4b13d6f5)
18
+
7
19
  #### [1.0.7](https://github.com/outliant/sunrise-utils/compare/1.0.6...1.0.7)
8
20
 
21
+ > 9 March 2023
22
+
9
23
  - chore: support multiple sorting #860px39yc [`133144d`](https://github.com/outliant/sunrise-utils/commit/133144d805126d301543e1df50510b982ea0f130)
24
+ - chore(release): 1.0.7 [`617bf83`](https://github.com/outliant/sunrise-utils/commit/617bf83a2ac80e030b0a81e9cdce0bd719b9e27b)
10
25
 
11
26
  #### [1.0.6](https://github.com/outliant/sunrise-utils/compare/1.0.5...1.0.6)
12
27
 
@@ -1,11 +1,11 @@
1
1
  const moment = require('moment');
2
2
  const { escapeElasticQuery } = require('../es');
3
3
 
4
- function getContainsMappingValue (filter) {
4
+ function getContainsMappingValue(filter) {
5
5
  if (['text', 'textarea'].includes(filter.field_type)) {
6
6
  return {
7
7
  bool: {
8
- must: [
8
+ should: [
9
9
  {
10
10
  match: {
11
11
  [`fields.text.analyzed`]: {
@@ -13,6 +13,11 @@ function getContainsMappingValue (filter) {
13
13
  operator: 'and'
14
14
  }
15
15
  }
16
+ },
17
+ {
18
+ match_phrase_prefix: {
19
+ [`fields.text.analyzed`]: filter.value
20
+ }
16
21
  }
17
22
  ]
18
23
  }
@@ -85,9 +90,15 @@ module.exports.containsAny = (filter) => {
85
90
  }
86
91
  },
87
92
  {
88
- nested: {
89
- path: 'fields',
90
- query: mapping
93
+ bool: {
94
+ should: [
95
+ {
96
+ nested: {
97
+ path: 'fields',
98
+ query: mapping
99
+ }
100
+ }
101
+ ]
91
102
  }
92
103
  }
93
104
  ]
@@ -43,6 +43,12 @@ module.exports = (query = {}, searchFields = []) => {
43
43
  fields: localFields.map((x) => `${x}^5`)
44
44
  }
45
45
  });
46
+
47
+ should.push({
48
+ match_phrase_prefix: {
49
+ name: parsedQuery
50
+ }
51
+ });
46
52
  }
47
53
  }
48
54
 
@@ -220,6 +220,7 @@ module.exports.buildTaskPipelineFilter = (filter) => {
220
220
  case 'dealinformation':
221
221
  case 'contactinformation':
222
222
  case 'ticketinformation':
223
+ case 'taskfield':
223
224
  return buildProjectFieldFilter(filter);
224
225
  default:
225
226
  // Task Fields
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@outliant/sunrise-utils",
3
3
  "description": "Helper functions for project Sunrise",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "license": "ISC",
6
6
  "author": "Outliant",
7
7
  "main": "index.js",