Always show text, make text extract size configurable.
authorChristian Weiske <cweiske@cweiske.de>
Thu, 1 Sep 2016 05:47:49 +0000 (07:47 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 1 Sep 2016 05:47:49 +0000 (07:47 +0200)
Resolves: #8

data/config.php.dist
src/phinde/Elasticsearch.php

index 20bf208356fcac5c017d61609efa15766c5d114b..1e2641a4c91ffb1f1f751f5fc653adce2c8a2fc0 100644 (file)
@@ -25,5 +25,8 @@ $GLOBALS['phinde'] = array(
     //prefix for the gearman queue names, needed when multiple instances
     //are running in parallel
     'queuePrefix' => '',
+    //show the full text content in the results
+    // useful for chat logs in which every line is its own document
+    'showFullContent' => false,
 );
 ?>
\ No newline at end of file
index 40358611edb1cb3dc69e929cd13e6fe141869991..c437036794c1724d19e444c12b1fd1b8802ebc4a 100644 (file)
@@ -136,6 +136,11 @@ class Elasticsearch
             $sortCfg = array();
         }
 
+        $contentMatchSize = 100;
+        if ($GLOBALS['phinde']['showFullContent']) {
+            $contentMatchSize = 999999;
+        }
+
         $r = new Elasticsearch_Request(
             $this->baseUrl . 'document/_search',
             \HTTP_Request2::METHOD_GET
@@ -168,6 +173,8 @@ class Elasticsearch
                     'text' => array(
                         'require_field_match' => false,
                         'number_of_fragments' => 1,
+                        'fragment_size' => $contentMatchSize,
+                        'no_match_size' => $contentMatchSize,
                     ),
                 )
             ),