Dancer-SearchApp
view release on metacpan or search on metacpan
bin/index-ical.pl view on Meta::CPAN
};
# https://www.elastic.co/guide/en/elasticsearch/guide/current/one-lang-docs.html
#warn "Storing document";
$e->index({
index => $full_name,
type => 'file', # or 'attachment' ?!
#id => $msg->messageid,
id => $msg->{uid},
# index bcc, cc, to, from
# content-type, ...
body => { # "body" for non-bulk, "source" for bulk ...
#source => {
url => $msg->{url},
title => $msg->{summary} . "($calendar_def->{name})",
title_suggest => $msg->{title_suggest}, # ugh
folder => $calendar_def->{name},
from => $msg->{organizer},
#to => [ $msg->recipients ],
content => $msg->{html_content},
language => $lang,
bin/index-imap.pl view on Meta::CPAN
# https://www.elastic.co/guide/en/elasticsearch/guide/current/one-lang-docs.html
#warn "Storing document";
$e->index({
index => $full_name,
type => 'mail', # or 'attachment' ?!
#id => $msg->messageid,
id => $msg->uid,
# index bcc, cc, to, from
# content-type, ...
body => { # "body" for non-bulk, "source" for bulk ...
#source => {
url => $msg->messageid,
title => $msg->subject,
title_suggest => $msg->{title_suggest}, # ugh
folder => $msg->{folder},
#from => $msg->from,
#to => [ $msg->recipients ],
content => "From: " . join( ",", $msg->from ) . "<br/>\n To: " . join( ",", $msg->recipients ) . "<br/>\n" . $body,
language => $lang,
lib/CORION/Apache/Tika/Connection.pm view on Meta::CPAN
sub decode_response {
my( $self, $body ) = @_;
return decode_json( $body );
}
sub process_response {
my ( $self, $params, $code, $msg, $body, $headers ) = @_;
my $mime_type = $headers->{"content-type"};
my $is_encoded = $mime_type && $mime_type !~ m!^text/plain\b!;
# Request is successful
if ( $code >= 200 and $code <= 209 ) {
if ( defined $body and length $body ) {
# Let's hope it's JSON
$body = $self->decode_response($body)
if $is_encoded;
( run in 1.200 second using v1.01-cache-2.11-cpan-524268b4103 )