Skip to content

Commit

Permalink
v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Apr 19, 2024
1 parent 92cf478 commit 7d4ebc5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/OpensearchStore.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/OpensearchStore.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seneca/opensearch-store",
"version": "0.0.2",
"version": "0.0.3",
"description": "Seneca OpenSearch data storage plugin.",
"main": "dist/OpensearchStore.js",
"type": "commonjs",
Expand Down
4 changes: 2 additions & 2 deletions src/OpensearchStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function buildQuery(spec: { index: string; options: any; msg: any }) {
}
}

const vector$ = msg.vector$ || q.directive$?.vector$
const vector$ = msg.vector$ || q.vector$ || q.directive$?.vector$
if (vector$) {
parts.push({
knn: {
Expand Down Expand Up @@ -308,7 +308,7 @@ function buildQuery(spec: { index: string; options: any; msg: any }) {
function resolveIndex(msg: any, options: Options) {
const ent = msg.ent

const index = msg.index$ || msg.q?.index$
const index = msg.index$ || msg.q?.index$ || msg.q?.directive$?.index$
if (null != index) {
return index
}
Expand Down
2 changes: 2 additions & 0 deletions test/Opensearch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ describe('OpensearchStore', () => {

expect(resolveIndex({ ent: ent0, q: {}, index$: 'qaz' }, { index: {} })).toEqual('qaz')
expect(resolveIndex({ ent: ent0, q: { index$: 'qaz' } }, { index: {} })).toEqual('qaz')
expect(resolveIndex({ ent: ent0, q: { directive$: { index$: 'qaz' } } }, { index: {} }))
.toEqual('qaz')
}, 22222)


Expand Down

0 comments on commit 7d4ebc5

Please sign in to comment.