@infrab4a/connect 4.9.4-beta.1 → 4.9.4-beta.3

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/index.cjs.js CHANGED
@@ -2647,12 +2647,12 @@ class ProductsIndex {
2647
2647
  match_phrase: {
2648
2648
  name: {
2649
2649
  query: `${searchTerm}`,
2650
- boost: 3,
2650
+ boost: 4,
2651
2651
  },
2652
2652
  },
2653
2653
  },
2654
2654
  {
2655
- match: {
2655
+ match_phrase: {
2656
2656
  brand: {
2657
2657
  query: `${searchTerm}`,
2658
2658
  boost: 2,
@@ -2665,23 +2665,24 @@ class ProductsIndex {
2665
2665
  const complementSearch = searchTerm.split(' ');
2666
2666
  if (complementSearch.length > 1) {
2667
2667
  query.should.push({
2668
+ multi_match: {
2669
+ query: `${searchTerm}`,
2670
+ fields: ['name'],
2671
+ operator: 'AND',
2672
+ boost: 3,
2673
+ },
2674
+ }, {
2668
2675
  match_phrase: {
2669
2676
  name: {
2670
2677
  query: `${complementSearch.shift()}`,
2671
2678
  boost: 1,
2672
2679
  },
2673
2680
  },
2674
- }, {
2675
- multi_match: {
2676
- query: `${searchTerm}`,
2677
- fields: ['name'],
2678
- operator: 'AND',
2679
- boost: 2,
2680
- },
2681
2681
  });
2682
2682
  }
2683
2683
  const search = await this.adapter.query(this.index, {
2684
2684
  size,
2685
+ min_score: 1,
2685
2686
  _source: fields,
2686
2687
  query: {
2687
2688
  bool: query,
package/index.esm.js CHANGED
@@ -2623,12 +2623,12 @@ class ProductsIndex {
2623
2623
  match_phrase: {
2624
2624
  name: {
2625
2625
  query: `${searchTerm}`,
2626
- boost: 3,
2626
+ boost: 4,
2627
2627
  },
2628
2628
  },
2629
2629
  },
2630
2630
  {
2631
- match: {
2631
+ match_phrase: {
2632
2632
  brand: {
2633
2633
  query: `${searchTerm}`,
2634
2634
  boost: 2,
@@ -2641,23 +2641,24 @@ class ProductsIndex {
2641
2641
  const complementSearch = searchTerm.split(' ');
2642
2642
  if (complementSearch.length > 1) {
2643
2643
  query.should.push({
2644
+ multi_match: {
2645
+ query: `${searchTerm}`,
2646
+ fields: ['name'],
2647
+ operator: 'AND',
2648
+ boost: 3,
2649
+ },
2650
+ }, {
2644
2651
  match_phrase: {
2645
2652
  name: {
2646
2653
  query: `${complementSearch.shift()}`,
2647
2654
  boost: 1,
2648
2655
  },
2649
2656
  },
2650
- }, {
2651
- multi_match: {
2652
- query: `${searchTerm}`,
2653
- fields: ['name'],
2654
- operator: 'AND',
2655
- boost: 2,
2656
- },
2657
2657
  });
2658
2658
  }
2659
2659
  const search = await this.adapter.query(this.index, {
2660
2660
  size,
2661
+ min_score: 1,
2661
2662
  _source: fields,
2662
2663
  query: {
2663
2664
  bool: query,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.9.4-beta.1",
3
+ "version": "4.9.4-beta.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },