This file is indexed.

/usr/share/perl5/Catmandu/CQLSearchable.pm is in libcatmandu-perl 1.0700-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package Catmandu::CQLSearchable;

use Catmandu::Sane;

our $VERSION = '1.07';

use Moo::Role;
use namespace::clean;

with 'Catmandu::Searchable';

requires 'translate_sru_sortkeys';
requires 'translate_cql_query';

my $AROUND_SEARCH = sub {
    my ($orig, $self, %args) = @_;

    if (my $sru_sortkeys = delete $args{sru_sortkeys}) {
        $args{sort} = $self->translate_sru_sortkeys($sru_sortkeys);
    }
    if (my $cql_query = delete $args{cql_query}) {
        $args{query} = $self->translate_cql_query($cql_query);
    }

    $orig->($self, %args);
};

around search   => $AROUND_SEARCH;
around searcher => $AROUND_SEARCH;

around delete_by_query => sub {
    my ($orig, $self, %args) = @_;

    if (my $cql = delete $args{cql_query}) {
        $args{query} = $self->translate_cql_query($cql);
    }

    $orig->($self, %args);
    return;
};

1;

__END__

=pod

=head1 NAME

Catmandu::CQLSearchable - Optional role for CQL searchable stores

=head1 SYNOPSIS

    my $hits  = $store->bag->search(
           cql_query => 'keyword any dna',
           sru_sortkeys  => 'title',
           limit => 100,
    );

=head1 METHODS

=head2 search(cql_query => $cql, sru_sortkeys => $sort, ...)

This method behaves exactly like the C<search> method in L<Catmandu::Searchable> but with extra C<cql_query> and C<sru_sortkeys> arguments.

=head2 searcher(cql_query => $cql, sru_sortkeys => $sort, ...)

This method behaves exactly like the C<searcher> method in L<Catmandu::Searchable> but with extra C<cql_query> and C<sru_sortkeys> arguments.

=head2 delete_by_query(cql_query => $cql, ...)

This method behaves exactly like the C<delete_by_query> method in L<Catmandu::Searchable> but with an extra C<cql_query> argument.

=head1 SEE ALSO

L<Catmandu::Searchable>

=cut