I think this is a common problem, but don't know the correct solution.
Users were doing queries on a numeric field such as qdur:[73 TO 117] and expecting to find all the values within but this fails because lucene treats the numbers as strings and just does alphabetical search. So I now index the field using NumberTools.longToString() so allows equivalent search i.e. qdur:[00000000000021 TO 00000000000039] which works correctly.
Trouble user types query into a free text field and cannot expect user to do the conversion, so I need to convert qdur:[73 TO 117] to qdur:[00000000000021 TO 00000000000039] before doing the lucene search, Im trying to do this with regular expressions but not convinced its safe for all variations, is there a better way (Im using Lucene 2.9)?
Paul --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org