mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-09-22 20:36:05 -04:00
Lucene 3 has no numeric type, so a number field is indexed zero-padded to make a range sort: 600 minutes is stored as "00000600.00". Every other field keeps the number as written, so the novel "1984" is stored as "1984". Padding every number in a query regardless of the field it was being compared against made a numeric title unfindable - "title:1984" looked for "00001984.00" among the titles - and a bare "1984" could only ever mean "some number field is 1984". A number now takes the spelling its field is indexed in. With no field named, the default field holds both spellings, so both are searched. A range and a phrase cannot hold that disjunction: a range stays padded, a phrase does not. Expanding a bare number to a group exposed the pure-negation workaround, which judged a query by every clause in its tree, so "-(a OR b)" was read as mixed and returned nothing. It is now decided per query by that query's own clauses. Co-authored-by: rmcrackan <rmcrackan@gmail.com>