Add configurable match-info extension support

Change-Id: I642c7863f1249025c518ee3402536fb07b26e529
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index 0d835e9..99e7d8f 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -347,7 +347,7 @@
 
   if (exists $conf->{defaults}) {
     my $def = $conf->{defaults};
-    foreach (qw!items_per_page context alignment!) {
+    foreach (qw!items_per_page context alignment match_info_extended!) {
       $self->defaults($_ => $def->{$_}) if $def->{$_};
     };
   };
diff --git a/lib/Kalamar/Controller/Search.pm b/lib/Kalamar/Controller/Search.pm
index 70fceac..472fd31 100644
--- a/lib/Kalamar/Controller/Search.pm
+++ b/lib/Kalamar/Controller/Search.pm
@@ -482,6 +482,7 @@
   $v->optional('foundry');
   $v->optional('layer');
   $v->optional('spans')->in(qw/true false/);
+  $v->optional('extended', 'trim');
   $v->optional('response-pipe', 'trim');
 
   # Check validation
@@ -518,6 +519,10 @@
     $query{spans} = $v->param('spans') if $v->param('spans');
   };
 
+  if (defined $v->param('extended') && $v->param('extended') ne '') {
+    $query{extended} = $v->param('extended');
+  };
+
   # Response pipe
   if ($v->param('response-pipe')) {
 
@@ -814,6 +819,11 @@
 Boolean value - either C<true> or C<false> - indicating, whether span information
 (i.e. for tree structures) should be retrieved.
 
+=item B<extended>
+
+Optional value forwarded to the backend match-info request. Configure this to
+request wider match context, for example C<max>.
+
 =back