-
Notifications
You must be signed in to change notification settings - Fork 149
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 #536 from fergiemcdowall/v2-issue-535
fix issue #535
- Loading branch information
Showing
8 changed files
with
107 additions
and
34 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
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 |
---|---|---|
@@ -1 +1 @@ | ||
search-index-2.2.0.js | ||
search-index-2.3.0.js |
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
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
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,55 @@ | ||
const si = require('../../') | ||
const test = require('tape') | ||
|
||
const sandbox = 'test/sandbox/' | ||
|
||
const docs = [ | ||
{ _id: 'qwertyu', idx: 'q' }, | ||
{ _id: 'asdfgh', idx: 'a' } | ||
] | ||
|
||
test('set up as per issue #535', async function (t) { | ||
t.plan(7) | ||
|
||
const { PUT, QUERY, FLUSH } = await si({ | ||
name: sandbox + '535' | ||
}) | ||
t.ok(PUT) | ||
|
||
t.deepEquals(await PUT(docs), [ | ||
{ _id: 'qwertyu', status: 'CREATED', operation: 'PUT' }, | ||
{ _id: 'asdfgh', status: 'CREATED', operation: 'PUT' } | ||
]) | ||
|
||
t.deepEquals(await QUERY({ | ||
SEARCH: ['q'] | ||
}), { | ||
RESULT: [ | ||
{ _id: 'qwertyu', _match: ['idx:q#1.00'], _score: 1.1 } | ||
], | ||
RESULT_LENGTH: 1 | ||
}) | ||
|
||
t.ok(await FLUSH()) | ||
|
||
t.deepEquals(await QUERY({ | ||
SEARCH: ['q'] | ||
}), { | ||
RESULT: [], | ||
RESULT_LENGTH: 0 | ||
}) | ||
|
||
t.deepEquals(await PUT(docs), [ | ||
{ _id: 'qwertyu', status: 'CREATED', operation: 'PUT' }, | ||
{ _id: 'asdfgh', status: 'CREATED', operation: 'PUT' } | ||
]) | ||
|
||
t.deepEquals(await QUERY({ | ||
SEARCH: ['q'] | ||
}), { | ||
RESULT: [ | ||
{ _id: 'qwertyu', _match: ['idx:q#1.00'], _score: 1.1 } | ||
], | ||
RESULT_LENGTH: 1 | ||
}) | ||
}) |