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 20bf208..1e2641a 100644 (file)
@@ -25,5 +25,8 @@ $GLOBALS['phinde'] = array(
     //prefix for the gearman queue names, needed when multiple instances
     //are running in parallel
     'queuePrefix' => '',
     //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
 );
 ?>
\ No newline at end of file
index 4035861..c437036 100644 (file)
@@ -136,6 +136,11 @@ class Elasticsearch
             $sortCfg = array();
         }
 
             $sortCfg = array();
         }
 
+        $contentMatchSize = 100;
+        if ($GLOBALS['phinde']['showFullContent']) {
+            $contentMatchSize = 999999;
+        }
+
         $r = new Elasticsearch_Request(
             $this->baseUrl . 'document/_search',
             \HTTP_Request2::METHOD_GET
         $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,
                     'text' => array(
                         'require_field_match' => false,
                         'number_of_fragments' => 1,
+                        'fragment_size' => $contentMatchSize,
+                        'no_match_size' => $contentMatchSize,
                     ),
                 )
             ),
                     ),
                 )
             ),