fix(lucene adapter and search tests): Improve range query parsing in Lucene adapter and expand search test coverage

This commit is contained in:
2025-04-22 18:24:26 +00:00
parent c5a44da975
commit 75aeb12e81
6 changed files with 47 additions and 3 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartdata',
version: '5.11.2',
version: '5.11.3',
description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.'
}

View File

@ -290,11 +290,11 @@ export class LuceneParser {
const includeLower = this.tokens[this.pos] === '[';
const includeUpper = this.tokens[this.pos + 4] === ']';
this.pos++; // Skip open bracket
// Ensure tokens for lower, TO, upper, and closing bracket exist
if (this.pos + 4 >= this.tokens.length) {
throw new Error('Invalid range query syntax');
}
this.pos++; // Skip open bracket
const lower = this.tokens[this.pos];
this.pos++;