DOKK / manpages / debian 10 / libplucene-perl / Plucene::Document::DateSerializer.3pm.en
Plucene::Document::DateSerializer(3pm) User Contributed Perl Documentation Plucene::Document::DateSerializer(3pm)

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

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

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.

        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.

        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.

2018-04-02 perl v5.26.1