Skip to content

Commit

Permalink
use match_phrase. fix test release/moose
Browse files Browse the repository at this point in the history
in document matching when we want to keep the order of words,
we need to use `match_phrase` instead of `match`.
  • Loading branch information
mickeyn committed May 5, 2016
1 parent 892cebf commit f7fd585
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/MetaCPAN/Document/File/Set.pm
Expand Up @@ -333,9 +333,9 @@ sub history {
{
bool => {
must => [
{ match => { documentation => $module } },
{ term => { indexed => 1 } },
{ term => { authorized => 1 } },
{ match_phrase => { documentation => $module } },
{ term => { indexed => 1 } },
{ term => { authorized => 1 } },
]
}
}
Expand Down
6 changes: 4 additions & 2 deletions t/release/moose.t
Expand Up @@ -22,7 +22,8 @@ is( $moose[1]->main_module, 'Moose', 'main_module ok' );
ok(
my $faq
= $idx->type('file')
->filter( { match => { documentation => 'Moose::FAQ' } } )->first,
->filter( { match_phrase => { documentation => 'Moose::FAQ' } } )
->first,
'get Moose::FAQ'
);

Expand All @@ -43,7 +44,8 @@ ok( $binary->binary, 'is binary' );
ok(
my $ppport
= $idx->type('file')
->filter( { match => { documentation => 'ppport.h' } } )->first,
->filter( { match_phrase => { documentation => 'ppport.h' } } )
->first,
'get ppport.h'
);

Expand Down
4 changes: 2 additions & 2 deletions t/release/multiple-modules.t
Expand Up @@ -114,8 +114,8 @@ ok(
my $file = $idx->type('file')->filter(
{
and => [
{ term => { release => 'Multiple-Modules-0.1' } },
{ match => { documentation => 'Moose' } }
{ term => { release => 'Multiple-Modules-0.1' } },
{ match_phrase => { documentation => 'Moose' } }
]
}
)->first,
Expand Down

0 comments on commit f7fd585

Please sign in to comment.