is empty lucene query with OR fix (#10451)

* empty lucene query with OR fix

* Fix unit test
This commit is contained in:
melohagan 2023-04-28 17:17:32 +01:00 committed by GitHub
parent 9eef7acdb3
commit 8742fb39d3
2 changed files with 2 additions and 2 deletions

View File

@ -417,7 +417,7 @@ export class QueryBuilder<T> {
})
}
if (this.query.empty) {
build(this.query.empty, (key: string) => `!${key}:["" TO *]`)
build(this.query.empty, (key: string) => `(*:* -${key}:["" TO *])`)
}
if (this.query.notEmpty) {
build(this.query.notEmpty, (key: string) => `${key}:["" TO *]`)

View File

@ -105,7 +105,7 @@ describe("internal search", () => {
"column": "",
},
}, PARAMS)
checkLucene(response, `*:* AND !column:["" TO *]`, PARAMS)
checkLucene(response, `*:* AND (*:* -column:["" TO *])`, PARAMS)
})
it("test notEmpty query", async () => {