File Coverage

blib/lib/Search/Query/Dialect/KSx/NOTWildcardQuery.pm
Criterion Covered Total %
statement 12 14 85.7
branch n/a
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 17 20 85.0


line stmt bran cond sub pod time code
1             package Search::Query::Dialect::KSx::NOTWildcardQuery;
2 3     3   19 use strict;
  3         8  
  3         113  
3 3     3   15 use warnings;
  3         6  
  3         116  
4 3     3   15 use base qw( Search::Query::Dialect::KSx::WildcardQuery );
  3         7  
  3         2379  
5 3     3   25 use Carp;
  3         5  
  3         409  
6              
7             our $VERSION = '0.201';
8              
9             =head1 NAME
10              
11             Search::Query::Dialect::KSx::NOTWildcardQuery - KinoSearch query extension
12              
13             =head1 SYNOPSIS
14              
15             my $query = Search::Query->parser( dialect => 'KSx' )->parse('myfield!:foo*');
16             my $ks_query = $query->as_ks_query();
17             # $ks_query isa NOTWildcardQuery
18              
19             =head1 DESCRIPTION
20              
21             If a WildcardQuery is equivalent to this:
22              
23             $term =~ m/$query/
24              
25             then a NOTWildcardQuery is equivalent to this:
26              
27             $term !~ m/$query/
28              
29             B that the as_ks_query() method in Dialect::KSx does B use
30             this class but instead wraps a WildcardQuery in a NOTQuery, which allows
31             for matching null values as well. So currently this class is not used
32             by Search::Query::Dialect::KSx but is included here in case someone finds it
33             useful.
34              
35             =head1 METHODS
36              
37             This class isa Search::Query::Dialect::KSx::WildcardQuery subclass.
38             Only new or overridden methods are documented.
39              
40             =head2 make_compiler
41              
42             Returns a Search::Query::Dialect::KSx::Compiler object.
43              
44             =cut
45              
46             sub make_compiler {
47 0     0 1   my $self = shift;
48 0           return Search::Query::Dialect::KSx::Compiler->new(
49             @_,
50             parent => $self,
51             include => 0,
52             );
53             }
54              
55             1;
56              
57             __END__