@terascope/elasticsearch-api 4.7.1 → 4.8.0

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.js CHANGED
@@ -642,8 +642,6 @@ export default function elasticsearchApi(client, logger, _opConfig) {
642
642
  const retry = _retryFn(_performSearch, query, reject);
643
643
 
644
644
  function _performSearch(queryParam) {
645
- _esV7adjustments(queryParam);
646
-
647
645
  client
648
646
  .search(queryParam)
649
647
  .then((data) => {
@@ -685,12 +683,6 @@ export default function elasticsearchApi(client, logger, _opConfig) {
685
683
  });
686
684
  }
687
685
 
688
- function _esV7adjustments(queryParam) {
689
- if (!isElasticsearch6()) {
690
- queryParam.trackTotalHits = true;
691
- }
692
- }
693
-
694
686
  function _adjustTypeForEs7(query) {
695
687
  if (!isElasticsearch6()) {
696
688
  if (Array.isArray(query)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@terascope/elasticsearch-api",
3
3
  "displayName": "Elasticsearch API",
4
- "version": "4.7.1",
4
+ "version": "4.8.0",
5
5
  "description": "Elasticsearch client api used across multiple services, handles retries and exponential backoff",
6
6
  "homepage": "https://github.com/terascope/teraslice/tree/master/packages/elasticsearch-api#readme",
7
7
  "bugs": {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@terascope/types": "~1.4.1",
28
- "@terascope/utils": "~1.7.1",
28
+ "@terascope/utils": "~1.7.2",
29
29
  "bluebird": "~3.7.2",
30
30
  "setimmediate": "~1.0.5"
31
31
  },
@@ -33,7 +33,7 @@
33
33
  "@opensearch-project/opensearch": "~1.2.0",
34
34
  "@types/elasticsearch": "~5.0.43",
35
35
  "elasticsearch": "~15.4.1",
36
- "elasticsearch-store": "~1.7.1",
36
+ "elasticsearch-store": "~1.8.0",
37
37
  "elasticsearch6": "npm:@elastic/elasticsearch@~6.8.0",
38
38
  "elasticsearch7": "npm:@elastic/elasticsearch@~7.17.0",
39
39
  "elasticsearch8": "npm:@elastic/elasticsearch@~8.15.0"
package/test/api-spec.js CHANGED
@@ -405,19 +405,6 @@ describe('elasticsearch-api', () => {
405
405
  return expect(api.count(query)).resolves.toEqual(500);
406
406
  });
407
407
 
408
- it('adds track total hits to queries for es v7 indices', async () => {
409
- const query = { body: 'someQuery' };
410
- const es7client = cloneDeep(client);
411
-
412
- es7client.transport._config = { apiVersion: '7.0' };
413
-
414
- const api = esApi(es7client, logger);
415
-
416
- await api.count(query);
417
-
418
- expect(query).toEqual({ body: 'someQuery', size: 0, trackTotalHits: true });
419
- });
420
-
421
408
  it('can search', async () => {
422
409
  const query = { body: 'someQuery' };
423
410
  const api = esApi(client, logger);