You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucy.apache.org by "Nick D." <nd...@globaldataguard.com> on 2014/01/28 22:57:04 UTC

Re: [lucy-user] Indexing Lucy::Plan::Int32Type

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.

Re: [lucy-user] Indexing Lucy::Plan::Int32Type

Posted by Marvin Humphrey <ma...@rectangular.com>.
On Tue, Jan 28, 2014 at 1:57 PM, Nick D. <nd...@globaldataguard.com> wrote:

> 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.

It can be unstored.  The data structures for full-document retrieval
and sorting are separate.

Marvin Humphrey