Skip to content

Commit 65ca691

Browse files
committed
No longer need this boolean re-cast; ES indexes return proper bools now.
As per discussion in metacpan/metacpan-web#2438, the ElasticSearch indices that back the MetaCPAN API have been updated to now consistently return Boolean values for the `deprecated` field. Thus, no longer need this check for string `"true"` or `"false"` values, which would then be cast accordingly to a proper boolean.
1 parent 4fd414c commit 65ca691

File tree

1 file changed

+0
-6
lines changed
  • lib/MetaCPAN/Document/File

1 file changed

+0
-6
lines changed

lib/MetaCPAN/Document/File/Set.pm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,6 @@ sub autocomplete_suggester {
628628
( $_->{fields}{documentation}[0] => \%record );
629629
} @{ $data->{hits}{hits} };
630630

631-
# normalize 'deprecated' field values to boolean (1/0) values (because ES)
632-
for my $v ( values %valid ) {
633-
$v->{deprecated} = 1 if $v->{deprecated} eq 'true';
634-
$v->{deprecated} = 0 if $v->{deprecated} eq 'false';
635-
}
636-
637631
# remove any exact match, it will be added later
638632
my $exact = delete $valid{$query};
639633

0 commit comments

Comments
 (0)