| 1 | package App::ElasticSearch::Utilities::QueryString::BareWords; | ||||||||||
| 2 | # ABSTRACT: Mostly fixing case and tracking dangling words | ||||||||||
| 3 | |||||||||||
| 4 | 2 | ▶ | use v5.16; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | our $VERSION = '9.1'; # VERSION | |||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use CLI::Helpers qw(:output); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 2 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | with 'App::ElasticSearch::Utilities::QueryString::Plugin'; | |||||||||
| 14 | |||||||||||
| 15 | 1 | ▶ | sub _build_priority { 1; } | ||||||||
|
Subroutine
_build_priority: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 1 | my %BareWords = ( | |||||||||
| 18 | and => { query_string => 'AND', invert => 0, dangles => 1 }, | ||||||||||
| 19 | or => { query_string => 'OR', invert => 0, dangles => 1 }, | ||||||||||
| 20 | not => { query_string => 'NOT', invert => 1, dangles => 1 }, | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | |||||||||||
| 24 | 22 | ▶ | sub handle_token { | ||||||||
|
Subroutine
handle_token: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 25 | 22 | my ($self,$token) = @_; | |||||||||
| 26 | |||||||||||
| 27 | 22 | debug(sprintf "%s - evaluating token '%s'", $self->name, $token); | |||||||||
| 28 | 22 | ▶ | return exists $BareWords{lc $token} ? [$BareWords{lc $token}] : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | # Return True; | ||||||||||
| 32 | 1 | 1; | |||||||||
| 33 | |||||||||||
| 34 | __END__ | ||||||||||