lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Lea" <>
Subject Re: Searching substring starting at a fixed position
Date Thu, 11 Sep 2008 14:06:28 GMT

RegexQuery might work, or how about splitting the digit string out into dates
and search for them e.g. 110001111 could be stored as "avail: jan03 jan04
jan05" and a search for +avail:jan03 +avail:jan04 +avail:jan05 would get a


On Thu, Sep 11, 2008 at 12:34 PM, luther blisset <> wrote:
> hi folks,
> I'm new to Lucene and I'm looking for a way to search a substring that
> starts at a fixed position.
> It isn't a classical substring search because it's a bit weird.
> I indexed a field that represents the avability of a room in a hostal during
> 1 year.
> The field is composed by 365 digits and each digit represents 1 day and it
> can be set at 0 (available) or 1 (not available). Thus a string like this:
> 110001111...(continues with ones until the position 365)
> means that the hostal is available from 3rd until 5th of January.
> And now the problem...
> Suppose that I want to search if an hostal is available from 3rd to 5th of
> January...
> I'd have to use wildcards and search a string like this:
> ??000????...(continues with ? until the position 365)
> I think this way is not a good one and is too bad for the application
> perfomance.
> Is there a way to ask Lucene to search starting from a fixed position?
> For instance, regard to the example above, could I search a 000 starting to
> search at the third position?
> I hope all was clear and you can help me because I've no idea how to solve
> the problem.
> Thanks a lot!
> Luther
> --
> View this message in context:
> Sent from the Lucene - Java Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message