logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Plucene::Document::DateSerializer - Utility functions for dealing with dates

Description

       Dates and times in Plucene should be serialized using the "freeze_date" function so that the
       Plucene::Search::DateFilter can filter on them during future searches.

Name

       Plucene::Document::DateSerializer - Utility functions for dealing with dates

Subroutines

freeze_date
               my $string = freeze_date(Time::Piece $t)

       This routine, exported by default, turns a "Time::Piece" object into a string in a format expected by
       both Plucene and Lucene.

   thaw_date
               my Time::Piece $t = Plucene::Document::DateSerializer::thaw_date($string)

       This routine is not exported, and is not used by the Plucene core. It is useful for debugging dates, and
       simply reverses the "freeze_date" operation.

perl v5.36.0                                       2022-12-04             Plucene::Document::DateSerializer(3pm)

Synopsis

               use Plucene::Document::DateSerializer
               my $field = Plucene::Document::Field->Text(
                       date => freeze_date(Time::Piece $t)
               );
               $doc->add($field);

See Also