Plucen...eFilter(3pm)
π Plucene::Search::DateFilter π
okay bestie, welcome to Plucene::Search::DateFilter β it's a little Perl module from the Plucene fam (that's the Perl port of Lucene, iykyk) and it lives in the User Contributed Perl Documentation crew. Its whole personality? restricting your search results to specific time periods. Periodt. Time-wise, not punctuation-wise. π°οΈβ¨
πΈ NAME πΈ
Plucene::Search::DateFilter β restrict searches to given time periods π
Like, you search, but only inside the dates you pick. It's giving very selective. π
β¨ SYNOPSIS β¨
my $filter = Plucene::Search::DateFilter->new({
field => "date",
from => Time::Piece $from,
to => Time::Piece $to
})
my $hits = $searcher->search($query, $filter);
Make the filter, hand it to the searcher, get hits. Simple as that, no cap. π¦
π«Ά DESCRIPTION π«Ά
So here's the tea: this class can restrict the results of a search to a set of dates. That's literally its whole job and it does it flawlessly. π
But β important β for this to work, you need a field that was indexed using Plucene::Document::DateSerializer. That's non-negotiable, bestie. If you didn't serialize your date field that way, this filter's just gonna sit there looking cute with nothing to do. π
For the actual how-to on doing that indexing thing, go read the documentation for that module. It's got you. π
π METHODS π
π new π
my $filter = Plucene::Search::DateFilter->new({
field => "date",
from => Time::Piece $from,
to => Time::Piece $to
})
This creates a new filter. Brand new, fresh out the box, main character energy. β¨
And here's the flexible bit: either from or to are optional. So you can totally do just a "from this date onward" vibe, or a "up to this date" vibe, or both if you're feeling thorough. Your call, queen. π
π bits π
This one's used by the searcher to iterate over the documents and return a bitfield specifying which documents are included in the range.
Translation: it's the behind-the-scenes bestie doing the actual "which of these docs make the cut" math. You probably won't call it yourself, but you should still respect it. π«‘
π heads up: your date field needs Plucene::Document::DateSerializer or this whole thing is a no-op. Do not skip that step, fr fr.
and that's the whole page, bestie! π this gem was documented by the User Contributed Perl Documentation crew, sitting at perl v5.36.0 with a date of 2022-12-04, and yes, the page title is Plucen...eFilter(3pm) because apparently even manpage titles get the β¨abbreviatedβ¨ treatment. slay. ππΈπ¦
π¦ where this page comes from
- debian bookworm: libplucene-perl 1.25-5
- debian trixie: libplucene-perl 1.25-5
- ubuntu noble: libplucene-perl 1.25-5
- ubuntu resolute: libplucene-perl 1.25-5
- ubuntu stonking: libplucene-perl 1.25-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms