Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elastic 7 support #502

Open
wants to merge 1 commit into
base: master
from

Conversation

@guumaster
Copy link
Member

guumaster commented Sep 12, 2019

First we need to add support for Elastic v7+ and then migrate to the new official client.

Check this guide on Elastic.co

Guumaster
@ci-reporter

This comment has been minimized.

Copy link

ci-reporter bot commented Sep 12, 2019

The build is failing

Good work on this PR so far! Unfortunately, the build is failing as of . Here's the output:

npm test
> mongoosastic@4.5.1 test /home/travis/build/mongoosastic/mongoosastic
> npm run lint && npm run mocha


> mongoosastic@4.5.1 lint /home/travis/build/mongoosastic/mongoosastic
> eslint lib test


> mongoosastic@4.5.1 mocha /home/travis/build/mongoosastic/mongoosastic
> istanbul cover _mocha --report lcovonly -- test/*-test.js



  Index Method
(node:10873) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
    ✓ should be able to index it directly without saving (3227ms)
    ✓ should be able to index to alternative index (3208ms)

  Add Boost Option Per Field
    1) should create a mapping with boost field added

  Bulk mode
    2) should index all objects and support deletions too

  Elasticsearch Connection
    3) should be able to connect with default options
    4) should be able to connect with explicit options
    5) should be able to connect with an array of hosts
    6) should be able to connect with an existing elasticsearch client

  Count
    ✓ should count a type
    ✓ should count a type without query

  Custom Properties for Mapping
    7) should index with field "fullTitle"

  Custom Serialize
    ✓ should index all fields returned from the customSerialize function (3180ms)

  Filter mode
    8) should index horror genre
    9) should not index action genre
    10) should unindex filtered models

  forceIndexRefresh connection option
    11) should always suceed: refresh the index immediately on insert
    12) should fail randomly: refresh the index every 1s on insert
    13) should always suceed: refresh the index immediately on update
    14) should fail randomly: refresh the index every 1s on update

  GeoTest
    15) "before all" hook

  Highlight search
    Highlight without hydrating
      16) should return highlighted text on every hit result
    Highlight hydrated results
      17) should return highlighted text on every resulting document

  Hydrate with ES data
    Preserve ordering from MongoDB on hydration
      18) should return an array of objects ordered 'desc' by MongoDB
    Preserve ordering from MongoDB on hydration
      19) should return an array of objects ordered 'asc' by MongoDB
    Preserve ordering from ElasticSearch on hydration
      20) should return an array of objects ordered 'desc' by ES
    Preserve ordering from ElasticSearch on hydration
      21) should return an array of objects ordered 'asc' by ES

  Hydrate with ES data
    Hydrate without adding ES data
      22) should return simple objects
    Hydrate and add ES data
      23) should return object enhanced with _esResult
      24) should remove _source object

  indexing
    Creating Index
      ✓ should create index if none exists (118ms)
      ✓ should create index with settings if none exists
      ✓ should update index if one already exists
    Default plugin
      ✓ should use the model's id as ES id
      25) should be able to execute a simple query
      26) should be able to execute a simple query
      27) should reindex when findOneAndUpdate
      ✓ should be able to execute findOneAndUpdate if document doesn't exist
      28) should be able to index with insertMany
      ✓ should report errors
    Removing
      29) should remove from index when model is removed
      30) should remove only index
      ✓ should queue for later removal if not in index (1036ms)
      31) should remove from index when findOneAndRemove
      ✓ should be able to execute findOneAndRemove if document doesn't exist
    Isolated Models
      32) should only find models of type Tweet
      33) should only find models of type Talk
    Always hydrate
      ✓ when gathering search results while respecting default hydrate options
    Subset of Fields
      34) should only return indexed fields
      35) should hydrate returned documents if desired
      36) should allow extra query options when hydrating
      Sub-object Fields
        ✓ should only return indexed fields and have indexed sub-objects
    Existing Index
      37) "before all" hook for "should just work"
    Disable automatic indexing
      ✓ should save but not index (3018ms)

  MappingGenerator
    type mapping
      ✓ maps field with simple text type
      ✓ maps field with text type attribute
      ✓ converts Date type to date
      ✓ removes _id field without prefix
      ✓ does not remove _id field with prefix
      ✓ converts object id to text if not _id
      ✓ does not modify the original schema tree
      ✓ recognizes an object and maps it as one
      ✓ recognizes an object and handles explict es_indexed
      ✓ recognizes a nested schema and handles explict es_indexed
      ✓ recognizes an multi_field and maps it as one
      ✓ recognizes an geo_point and maps it as one
      ✓ recognizes an geo_point with independent lat lon fields and maps it as one
      ✓ recognizes an nested schema and maps it
      ✓ recognizes an es_type of nested with es_fields and maps it
      ✓ recognizes a nested array with a simple type and maps it as a simple attribute
      ✓ recognizes a nested array with a simple type and additional attributes and maps it as a simple attribute
      ✓ recognizes a nested array with a complex object and maps it
      ✓ excludes a virtual property from mapping
      38) should not map type mixed on mixed fields
    elastic search fields
      ✓ type can be overridden
      ✓ adds the boost field
      ✓ respects schemas with explicit es_indexes
      ✓ make sure id is mapped
      ✓ maps all fields when schema has no es_indexed flag
    ref mapping
      ✓ maps all fields from referenced schema
      ✓ maps only selected fields from referenced schema
      ✓ maps all fields from array of referenced schema
      ✓ maps only selected fields from array of referenced schema
      ✓ maps a geo_point field of an nested referenced schema as a geo_point

  references
    indexing
      ✓ should index selected fields from referenced schema
      39) should be able to execute a simple query
      arrays of references
        ✓ should correctly index arrays
        ✓ should respect populate options

  Refresh
    40) should flushed after refresh

  Routing
    41) should found task if no routing
    42) should found task if routing with task.content
    43) should not found task if routing with invalid routing
    44) should not found task after remove
    45) should not found task after unIndex
    46) should not found task after esTruncate

  Query DSL
(node:10873) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'currentRetry' of undefined
    at /home/travis/build/mongoosastic/mongoosastic/node_modules/mocha/lib/runner.js:656:28
    at done (/home/travis/build/mongoosastic/mongoosastic/node_modules/mocha/lib/runnable.js:334:5)
    at /home/travis/build/mongoosastic/mongoosastic/node_modules/mocha/lib/runnable.js:398:11
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:10873) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10873) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    range
      47) should be able to find within range
    Sort
      Simple sort
        48) should be able to return all data, sorted by name ascending
        49) should be able to return all data, sorted by name descending
      Complex sort
        50) should be able to return all data, sorted by name ascending
        51) should be able to return all data, sorted by name descending
    Aggregations
      Simple aggregation
        ✓ should be able to group by term
    test
      52) should do a fuzzy query

  serialize
    ✓ should serialize a document with missing bits
    with no indexed fields
      ✓ should serialize model fields
      ✓ should serialize object ids as strings
      ✓ should serialize dates in ISO 8601 format
      ✓ should serialize nested arrays
      ✓ should cast and serialize field

  Suggesters
    Testing Suggest
      53) should index property name with type completion
      54) should return suggestions after hits

  Synchronize
    an existing collection with invalid field values
      55) should index all but one document
    an existing collection
      56) should index all existing objects
      57) should index all existing objects without saving them in MongoDB

  Transform mode
    58) should index with field "fullTitle"

  Truncate
    esTruncate
      59) should be able to truncate all documents


  55 passing (3m)
  59 failing

  1) Add Boost Option Per Field
       should create a mapping with boost field added:
     Uncaught TypeError: Cannot read property 'mappings' of undefined
      at /home/travis/build/mongoosastic/mongoosastic/test/boost-field-test.js:61:31
      at respond (node_modules/elasticsearch/src/lib/transport.js:368:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  2) Bulk mode
       should index all objects and support deletions too:
     Uncaught AssertionError: expected Object {
  total: Object { value: 52, relation: 'eq' },
  max_score: 1,
  hits: Array [
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f6135a',
      _score: 1,
      _source: Object { title: 'ABABABA0' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f61358',
      _score: 1,
      _source: Object { title: 'Gods of the Old World' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f61359',
      _score: 1,
      _source: Object { title: 'American Gothic' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f6135b',
      _score: 1,
      _source: Object { title: 'ABABABA1' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f61360',
      _score: 1,
      _source: Object { title: 'ABABABA6' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f61365',
      _score: 1,
      _source: Object { title: 'ABABABA11' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f6136a',
      _score: 1,
      _source: Object { title: 'ABABABA16' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f6136f',
      _score: 1,
      _source: Object { title: 'ABABABA21' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f61374',
      _score: 1,
      _source: Object { title: 'ABABABA26' }
    },
    Object {
      _index: 'book2s',
      _type: 'book2',
      _id: '5d7a1d904f70df2a79f61379',
      _score: 1,
      _source: Object { title: 'ABABABA31' }
    }
  ]
} to have property total of 52 (got Object { value: 52, relation: 'eq' })
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value [as property] (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/bulk-test.js:67:51
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  3) Elasticsearch Connection
       should be able to connect with default options:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/connection-test.js:29:33
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  4) Elasticsearch Connection
       should be able to connect with explicit options:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/connection-test.js:29:33
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  5) Elasticsearch Connection
       should be able to connect with an array of hosts:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/connection-test.js:29:33
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  6) Elasticsearch Connection
       should be able to connect with an existing elasticsearch client:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/connection-test.js:29:33
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  7) Custom Properties for Mapping
       should index with field "fullTitle":
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/custom-mapping-test.js:63:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  8) Filter mode
       should index horror genre:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/filtering-test.js:65:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  9) Filter mode
       should not index action genre:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/filtering-test.js:81:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  10) Filter mode
       should unindex filtered models:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/filtering-test.js:97:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  11) forceIndexRefresh connection option
       should always suceed: refresh the index immediately on insert:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/force-index-refresh-test.js:111:37
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  12) forceIndexRefresh connection option
       should fail randomly: refresh the index every 1s on insert:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/force-index-refresh-test.js:113:37
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  13) forceIndexRefresh connection option
       should always suceed: refresh the index immediately on update:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/force-index-refresh-test.js:145:41
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  14) forceIndexRefresh connection option
       should fail randomly: refresh the index every 1s on update:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/force-index-refresh-test.js:148:41
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  15) GeoTest
       "before all" hook:
     Uncaught TypeError: Cannot read property 'mappings' of undefined
      at /home/travis/build/mongoosastic/mongoosastic/test/geo-test.js:44:35
      at respond (node_modules/elasticsearch/src/lib/transport.js:368:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  16) Highlight search
       Highlight without hydrating
         should return highlighted text on every hit result:
     Uncaught AssertionError: expected Object { value: 3, relation: 'eq' } to equal 3
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/highlight-features-test.js:81:31
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  17) Highlight search
       Highlight hydrated results
         should return highlighted text on every resulting document:
     Uncaught AssertionError: expected Object { value: 3, relation: 'eq' } to equal 3
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/highlight-features-test.js:109:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  18) Hydrate with ES data
       Preserve ordering from MongoDB on hydration
         should return an array of objects ordered 'desc' by MongoDB:
     Uncaught AssertionError: expected Object { value: 4, relation: 'eq' } to equal 4
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/hydrate-preserves-ordering-test.js:68:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  19) Hydrate with ES data
       Preserve ordering from MongoDB on hydration
         should return an array of objects ordered 'asc' by MongoDB:
     Uncaught AssertionError: expected Object { value: 4, relation: 'eq' } to equal 4
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/hydrate-preserves-ordering-test.js:87:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  20) Hydrate with ES data
       Preserve ordering from ElasticSearch on hydration
         should return an array of objects ordered 'desc' by ES:
     Uncaught AssertionError: expected Object { value: 4, relation: 'eq' } to equal 4
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/hydrate-preserves-ordering-test.js:111:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  21) Hydrate with ES data
       Preserve ordering from ElasticSearch on hydration
         should return an array of objects ordered 'asc' by ES:
     Uncaught AssertionError: expected Object { value: 4, relation: 'eq' } to equal 4
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/hydrate-preserves-ordering-test.js:135:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  22) Hydrate with ES data
       Hydrate without adding ES data
         should return simple objects:
     Uncaught AssertionError: expected Object { value: 3, relation: 'eq' } to equal 3
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/hydrate-with-es-results-test.js:72:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  23) Hydrate with ES data
       Hydrate and add ES data
         should return object enhanced with _esResult:
     Uncaught AssertionError: expected Object { value: 3, relation: 'eq' } to equal 3
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/hydrate-with-es-results-test.js:99:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  24) Hydrate with ES data
       Hydrate and add ES data
         should remove _source object:
     Uncaught AssertionError: expected Object { value: 3, relation: 'eq' } to equal 3
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/hydrate-with-es-results-test.js:132:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  25) indexing
       Default plugin
         should be able to execute a simple query:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:181:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  26) indexing
       Default plugin
         should be able to execute a simple query:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:193:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  27) indexing
       Default plugin
         should reindex when findOneAndUpdate:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:213:39
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  28) indexing
       Default plugin
         should be able to index with insertMany:
     AssertionError: expected Object { value: 2, relation: 'eq' } to equal 2
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Context.<anonymous> (test/index-test.js:249:33)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co/index.js:65:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

  29) indexing
       Removing
         should remove from index when model is removed:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:284:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  30) indexing
       Removing
         should remove only index:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:299:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  31) indexing
       Removing
         should remove from index when findOneAndRemove:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:339:37
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  32) indexing
       Isolated Models
         should only find models of type Tweet:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:387:31
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  33) indexing
       Isolated Models
         should only find models of type Talk:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:399:31
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  34) indexing
       Subset of Fields
         should only return indexed fields:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:449:31
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  35) indexing
       Subset of Fields
         should hydrate returned documents if desired:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:469:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  36) indexing
       Subset of Fields
         should allow extra query options when hydrating:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/index-test.js:525:31
      at query.exec (lib/mongoosastic.js:9:9172)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/model.js:4616:16
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/mongoose/lib/utils.js:264:16
      at _hooks.execPost (node_modules/mongoose/lib/query.js:4320:11)
      at /home/travis/build/mongoosastic/mongoosastic/node_modules/kareem/index.js:135:16
      at _combinedTickCallback (internal/process/next_tick.js:132:7)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  37) indexing
       Existing Index
         "before all" hook for "should just work":
     Error: [mapper_parsing_exception] Root mapping definition has unsupported parameters:  [bum : {properties={name={type=text}}}]
      at respond (node_modules/elasticsearch/src/lib/transport.js:349:15)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  38) MappingGenerator
       type mapping
         should not map type mixed on mixed fields:
     Error: [illegal_argument_exception] Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true.
      at respond (node_modules/elasticsearch/src/lib/transport.js:349:15)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  39) references
       indexing
         should be able to execute a simple query:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/ref-test.js:93:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  40) Refresh
       should flushed after refresh:
     Error: [illegal_argument_exception] Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true.
      at respond (node_modules/elasticsearch/src/lib/transport.js:349:15)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  41) Routing
       should found task if no routing:
     AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Context.<anonymous> (test/routing-test.js:45:27)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co/index.js:65:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

  42) Routing
       should found task if routing with task.content:
     AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Context.<anonymous> (test/routing-test.js:64:27)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co/index.js:65:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

  43) Routing
       should not found task if routing with invalid routing:
     AssertionError: expected Object { value: 1, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Context.<anonymous> (test/routing-test.js:83:27)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co/index.js:65:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

  44) Routing
       should not found task after remove:
     AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Context.<anonymous> (test/routing-test.js:100:27)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co/index.js:65:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

  45) Routing
       should not found task after unIndex:
     AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Context.<anonymous> (test/routing-test.js:115:27)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co/index.js:65:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

  46) Routing
       should not found task after esTruncate:
     Uncaught Error: [illegal_argument_exception] Action/metadata line [1] contains an unknown parameter [_routing]
      at respond (node_modules/elasticsearch/src/lib/transport.js:349:15)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  47) Query DSL
       range
         should be able to find within range:
     Uncaught AssertionError: expected Object { value: 2, relation: 'eq' } to equal 2
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/search-features-test.js:77:31
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  48) Query DSL
       Sort
         Simple sort
           should be able to return all data, sorted by name ascending:
     Uncaught AssertionError: expected Object { value: 4, relation: 'eq' } to equal 4
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/search-features-test.js:101:33
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  49) Query DSL
       Sort
         Simple sort
           should be able to return all data, sorted by name descending:
     Uncaught AssertionError: expected Object { value: 4, relation: 'eq' } to equal 4
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/search-features-test.js:114:33
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  50) Query DSL
       Sort
         Complex sort
           should be able to return all data, sorted by name ascending:
     Uncaught AssertionError: expected Object { value: 4, relation: 'eq' } to equal 4
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/search-features-test.js:133:33
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  51) Query DSL
       Sort
         Complex sort
           should be able to return all data, sorted by name descending:
     Uncaught AssertionError: expected Object { value: 4, relation: 'eq' } to equal 4
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/search-features-test.js:153:33
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  52) Query DSL
       test
         should do a fuzzy query:
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/search-features-test.js:215:31
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  53) Suggesters
       Testing Suggest
         should index property name with type completion:
     Uncaught TypeError: Cannot read property 'mappings' of undefined
      at /home/travis/build/mongoosastic/mongoosastic/test/suggesters-test.js:84:31
      at respond (node_modules/elasticsearch/src/lib/transport.js:368:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  54) Suggesters
       Testing Suggest
         should return suggestions after hits:
     Uncaught TypeError: Cannot read property 'should' of undefined
      at /home/travis/build/mongoosastic/mongoosastic/test/suggesters-test.js:103:13
      at esClient.search (lib/mongoosastic.js:9:35039)
      at respond (node_modules/elasticsearch/src/lib/transport.js:368:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  55) Synchronize
       an existing collection with invalid field values
         should index all but one document:
     Uncaught AssertionError: expected Object { value: 2, relation: 'eq' } to equal 2
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Book.search (test/synchronize-test.js:88:39)
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  56) Synchronize
       an existing collection
         should index all existing objects:
     Uncaught AssertionError: expected Object { value: 2, relation: 'eq' } to equal 2
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Book.search (test/synchronize-test.js:128:39)
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  57) Synchronize
       an existing collection
         should index all existing objects without saving them in MongoDB:
     Uncaught AssertionError: expected Object { value: 2, relation: 'eq' } to equal 2
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Book.search (test/synchronize-test.js:154:39)
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  58) Transform mode
       should index with field "fullTitle":
     Uncaught AssertionError: expected Object { value: 1, relation: 'eq' } to equal 1
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/transform-test.js:68:35
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  59) Truncate
       esTruncate
         should be able to truncate all documents:
     Uncaught AssertionError: expected Object { value: 0, relation: 'eq' } to equal 0
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /home/travis/build/mongoosastic/mongoosastic/test/truncate-test.js:59:39
      at esClient.search (lib/mongoosastic.js:9:35458)
      at respond (node_modules/elasticsearch/src/lib/transport.js:370:9)
      at checkRespForFailure (node_modules/elasticsearch/src/lib/transport.js:306:7)
      at HttpConnector.<anonymous> (node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
      at IncomingMessage.wrapper (node_modules/lodash/lodash.js:4935:19)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)



=============================================================================
Writing coverage object [/home/travis/build/mongoosastic/mongoosastic/coverage/coverage.json]
Writing coverage reports at [/home/travis/build/mongoosastic/mongoosastic/coverage]
=============================================================================

=============================== Coverage summary ===============================
Statements   : 93% ( 518/557 )
Branches     : 86.83% ( 389/448 )
Functions    : 88.1% ( 37/42 )
Lines        : 93.08% ( 511/549 )
================================================================================
npm ERR! code ELIFECYCLE
npm ERR! errno 59
npm ERR! mongoosastic@4.5.1 mocha: `istanbul cover _mocha --report lcovonly -- test/*-test.js`
npm ERR! Exit status 59
npm ERR! 
npm ERR! Failed at the mongoosastic@4.5.1 mocha script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2019-09-12T10_30_30_698Z-debug.log

This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.
@guumaster

This comment has been minimized.

Copy link
Member Author

guumaster commented Sep 12, 2019

No clear idea where to start with this changes. @AxelJunker have you worked with Elastic 7?

@AjayAgAI

This comment has been minimized.

Copy link

AjayAgAI commented Oct 1, 2019

@guumaster I was hoping if you could explain me the problem. I am new to open source and would definitely love to contribute towards the same

@guumaster

This comment has been minimized.

Copy link
Member Author

guumaster commented Oct 1, 2019

@AjayAgAI no problem, I can explain why we need to change the library. A while back, Elastic decided to move the code from elasticsearch to @elastic/elasticsearch. Marking the first as "legacy" and continuing development on the later.

So, changing from the old library to @elastic/elasticsearch is needed in order to support Elastic version 7 and up. There is a migration guide here that we could use to make the changes while keeping the tests green.

@stale

This comment has been minimized.

Copy link

stale bot commented Nov 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.