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 Tue, 28 Jan 2014 21:57:04 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


Another question regarding this method of Range. Does the StringType have to
be stored or can I mark it unstored and still be able to use a RangeQuery on
it.

Is this valid to do a RangeQuery on this field:

my $unindexed_string_type = Lucy::Plan::StringType->new( indexed => 0,
sortable => 1, stored => 0  ); 

Or do I need this:

my $unindexed_string_type = Lucy::Plan::StringType->new( indexed => 0,
sortable => 1, stored => 1  ); 



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

Mime
View raw message