We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a Node has term: 0, the query returned by toString() will lack a value:
term: 0
toString()
> const lucene = require("lucene"); > lucene.toString({ ... "left": { ..... "field": "field", ..... "fieldLocation": { ....... "start": { ......... "offset": 0, ......... "line": 1, ......... "column": 1 ......... }, ....... "end": { ......... "offset": 5, ......... "line": 1, ......... "column": 6 ......... } ....... }, ..... "term": 0, // <----- ..... "quoted": false, ..... "regex": false, ..... "termLocation": { ....... "start": { ......... "offset": 6, ......... "line": 1, ......... "column": 7 ......... }, ....... "end": { ......... "offset": 7, ......... "line": 1, ......... "column": 8 ......... } ....... }, ..... "similarity": null, ..... "boost": null, ..... "prefix": null ..... } ... }); 'field:'
Changing "term": 0 to "term": "0" fixes the problem, returning 'field:0'.
"term": 0
"term": "0"
'field:0'
I think this is due to checking falsy values in these places:
lucene/lib/toString.js
Line 52 in 961ecf2
Line 77 in 961ecf2
Of course, a workaround is to always use strings as term values, but allowing numbers and returning an invalid query like this is very confusing.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When a Node has
term: 0
, the query returned bytoString()
will lack a value:Changing
"term": 0
to"term": "0"
fixes the problem, returning'field:0'
.I think this is due to checking falsy values in these places:
lucene/lib/toString.js
Line 52 in 961ecf2
lucene/lib/toString.js
Line 77 in 961ecf2
Of course, a workaround is to always use strings as term values, but allowing numbers and returning an invalid query like this is very confusing.
The text was updated successfully, but these errors were encountered: