Uwe Schindler wrote:
Actually what I ideally want I really want is for lucene to realise that
when a particular field is being searched (in this case qdur) it should
convert the values to allow the range to work properly, i.e by flagging
a field as being numeric when you create the index.
It is simple:
Subclass QueryParser and override getRangeQuery and construct the correct
range query for your field type. If the supplied field name is not the one
you want to modify pass to super().
Something like:
@Override public Query getRangeQuery(...) {
if ("qdur".equals(fieldname) {
...return YourFavoriteQuery...
} else return super.getRangeQuery(...)
}
This also works with the new NumericRangeQuery and NumericField as suggested
in other mails.
Uwe
Hi, okay thanks I can see this could work and I guess I would need to
override some other methods as well because qdur may not be used in a
range at al (i.e qdur:15)
(BTW In my case the whole query is entered by user in free text mode, so
the other method you suggested wouldnt work well)
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org