-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from social-native/fix/es710-results
Fix bug of not saving results from ES710
- Loading branch information
Showing
4 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Manager from '../manager'; | ||
|
||
describe('Manager', () => { | ||
describe('#_saveQueryResults', () => { | ||
it('saves ES 7.10 query results', () => { | ||
const fakeES710QueryResults = { | ||
took: 2, | ||
timed_out: false, | ||
_shards: {total: 1, successful: 1, skipped: 0, failed: 0}, | ||
hits: { | ||
total: {value: 10, relation: 'eq'}, | ||
max_score: 1, | ||
hits: [ | ||
{ | ||
_index: 'crm_index', | ||
_type: '_doc', | ||
_id: '_aLNPnkBrs-zuIFb2nyl', | ||
_score: 1, | ||
_source: {id: 234}, | ||
sort: [1, 0] | ||
}, | ||
{ | ||
_index: 'crm_index', | ||
_type: '_doc', | ||
_id: '_qKLP3kBrs-zuIFbcXxC', | ||
_score: 1, | ||
_source: {id: 2344, 'user_profile.birth_date': 712652400000}, | ||
sort: [1, 1] | ||
} | ||
] | ||
} | ||
}; | ||
// @ts-ignore | ||
const manager = new Manager(); | ||
manager._saveQueryResults(fakeES710QueryResults); | ||
expect(manager.results).toEqual(fakeES710QueryResults.hits.hits) | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters