On Thu, Dec 12, 2013 at 10:36 AM, Nick D. <[email protected]> wrote:
> Can I not use Int32Type when indexing integers that I want to do a range
> query on later?

That's right.  Int32Type isn't public and isn't ready for prime time in Lucy
0.3.x.

> Can you give me an example of the leading zeros because I think I tried that
> also but I may be miss understanding what you mean by leading zeros?

The idea is to define the field as an ordinary text type (probably StringType)
and add leading zeroes at *index-time*.

    # If `$time_sec` is 14, then `$fields{time_sec}` will be `"00014"`.
    $fields{time_sec} = sprintf("%0.5d", $time_sec);
    $indexer->add_doc(\%fields);

Then your query will work at search-time:

> my $range_query = Lucy::Search::RangeQuery->new(
>          field      => 'time_sec',
>          lower_term => '00014',
>      );

Marvin Humphrey

Reply via email to