File Coverage

blib/lib/Search/Query/Field/KSx.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Search::Query::Field::KSx;
2 3     3   17 use Moo;
  3         8  
  3         20  
3             extends 'Search::Query::Field';
4 3     3   1097 use Scalar::Util qw( blessed );
  3         5  
  3         251  
5              
6             our $VERSION = '0.201';
7              
8 3     3   2017 use namespace::sweep;
  3         32696  
  3         32  
9              
10             has 'type' => ( is => 'rw', default => sub {'char'} );
11             has 'is_int' => ( is => 'rw', default => sub {0} );
12             has 'analyzer' => ( is => 'rw' ); # TODO isa check
13              
14             =head1 NAME
15              
16             Search::Query::Field::KSx - query field representing a KinoSearch field
17              
18             =head1 SYNOPSIS
19              
20             my $field = Search::Query::Field::KSx->new(
21             name => 'foo',
22             alias_for => [qw( bar bing )],
23             );
24              
25             =head1 DESCRIPTION
26              
27             Search::Query::Field::KSx implements field
28             validation and aliasing in KinoSearch search queries.
29              
30             =head1 METHODS
31              
32             This class is a subclass of Search::Query::Field. Only new or overridden
33             methods are documented here.
34              
35             =head2 init
36              
37             Available params are also standard attribute accessor methods.
38              
39             =over
40              
41             =item type
42              
43             The column type. This may be a KinoSearch::FieldType object
44             or a simple string.
45              
46             =item is_int
47              
48             Set if C matches m/int|num|date/.
49              
50             =item analyzer
51              
52             Set to a KinoSearch::Analysis::Analyzer-based object (optional).
53              
54             =back
55              
56             =cut
57              
58             1;
59              
60             __END__