| 1 | # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| 2 | # contributor license agreements. See the NOTICE file distributed with | ||
| 3 | # this work for additional information regarding copyright ownership. | ||
| 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| 5 | # (the "License"); you may not use this file except in compliance with | ||
| 6 | # the License. You may obtain a copy of the License at | ||
| 7 | # | ||
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | # | ||
| 10 | # Unless required by applicable law or agreed to in writing, software | ||
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | # See the License for the specific language governing permissions and | ||
| 14 | # limitations under the License. | ||
| 15 | package LucyX::Build::Binding::Search; | ||
| 16 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | 1 | our $VERSION = '0.008000'; | |
| 20 | 1 | $VERSION = eval $VERSION; | |
| 21 | |||
| 22 | 1 | ▶ | sub bind_all { |
|
Subroutine
bind_all: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 23 | 1 | my $class = shift; | |
| 24 | 1 | $class->bind_filter; | |
| 25 | 1 | $class->bind_mockmatcher; | |
| 26 | 1 | $class->bind_proximityquery; | |
| 27 | 1 | $class->bind_proximitycompiler; | |
| 28 | } | ||
| 29 | |||
| 30 | 1 | ▶ | sub bind_filter { |
|
Subroutine
bind_filter: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 31 | 1 | my $binding = Clownfish::CFC::Binding::Perl::Class->new( | |
| 32 | parcel => "Lucy", | ||
| 33 | class_name => "LucyX::Search::FilterMatcher", | ||
| 34 | ); | ||
| 35 | 1 | $binding->bind_constructor; | |
| 36 | 1 | Clownfish::CFC::Binding::Perl::Class->register($binding); | |
| 37 | } | ||
| 38 | |||
| 39 | 1 | ▶ | sub bind_mockmatcher { |
|
Subroutine
bind_mockmatcher: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 40 | 1 | my $binding = Clownfish::CFC::Binding::Perl::Class->new( | |
| 41 | parcel => "Lucy", | ||
| 42 | class_name => "LucyX::Search::MockMatcher", | ||
| 43 | ); | ||
| 44 | 1 | $binding->bind_constructor( alias => '_new' ); | |
| 45 | 1 | Clownfish::CFC::Binding::Perl::Class->register($binding); | |
| 46 | } | ||
| 47 | |||
| 48 | 1 | ▶ | sub bind_proximityquery { |
|
Subroutine
bind_proximityquery: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 49 | 1 | my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new; | |
| 50 | 1 | my $synopsis = <<'END_SYNOPSIS'; | |
| 51 | my $proximity_query = LucyX::Search::ProximityQuery->new( | ||
| 52 | field => 'content', | ||
| 53 | terms => [qw( the who )], | ||
| 54 | within => 10, # match within 10 positions | ||
| 55 | ); | ||
| 56 | my $hits = $searcher->hits( query => $proximity_query ); | ||
| 57 | END_SYNOPSIS | ||
| 58 | 1 | $pod_spec->set_synopsis($synopsis); | |
| 59 | 1 | $pod_spec->add_constructor( alias => 'new' ); | |
| 60 | |||
| 61 | 1 | my $binding = Clownfish::CFC::Binding::Perl::Class->new( | |
| 62 | parcel => "Lucy", | ||
| 63 | class_name => "LucyX::Search::ProximityQuery", | ||
| 64 | ); | ||
| 65 | 1 | $binding->bind_constructor; | |
| 66 | 1 | $binding->set_pod_spec($pod_spec); | |
| 67 | |||
| 68 | 1 | Clownfish::CFC::Binding::Perl::Class->register($binding); | |
| 69 | } | ||
| 70 | |||
| 71 | 1 | ▶ | sub bind_proximitycompiler { |
|
Subroutine
bind_proximitycompiler: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 72 | 1 | my $binding = Clownfish::CFC::Binding::Perl::Class->new( | |
| 73 | parcel => "Lucy", | ||
| 74 | class_name => "LucyX::Search::ProximityCompiler", | ||
| 75 | ); | ||
| 76 | 1 | $binding->bind_constructor( alias => 'do_new' ); | |
| 77 | 1 | Clownfish::CFC::Binding::Perl::Class->register($binding); | |
| 78 | } | ||
| 79 | |||
| 80 | 1 | 1; | |