lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick D." <ndw...@globaldataguard.com>
Subject Re: [lucy-user] Indexing Lucy::Plan::Int32Type
Date Wed, 18 Dec 2013 21:28:09 GMT
Marvin Humphrey wrote
> On Thu, Dec 12, 2013 at 10:36 AM, Nick D. &lt;

> ndwyer@

> &gt; 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


Thanks this worked!



--
View this message in context: http://lucene.472066.n3.nabble.com/lucy-user-Indexing-Lucy-Plan-Int32Type-tp4103497p4107325.html
Sent from the lucy-user mailing list archive at Nabble.com.

Mime
View raw message