Skip to content

Commit aa16c48

Browse files
Fix query failure when the Lucene Query field is empty (#9)
1 parent a04d27b commit aa16c48

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quickwit-datasource",
3-
"version": "0.8.0+paypay",
3+
"version": "0.8.1+paypay",
44
"description": "Quickwit datasource",
55
"scripts": {
66
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",

src/datasource/base.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,10 @@ export class BaseQuickwitDataSource
396396
}
397397

398398
// Surround the query with () to ensure that the filters are properly AND'd
399-
let finalQuery = '(' + query + ')';
399+
let finalQuery = query.trim();
400+
if (finalQuery.length > 0) {
401+
finalQuery = '(' + finalQuery + ')';
402+
}
400403

401404
adhocFilters.forEach((filter) => {
402405
finalQuery = addAddHocFilter(finalQuery, filter);

0 commit comments

Comments
 (0)