aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/config.php.dist3
-rw-r--r--src/phinde/Elasticsearch.php7
2 files changed, 10 insertions, 0 deletions
diff --git a/data/config.php.dist b/data/config.php.dist
index 20bf208..1e2641a 100644
--- a/data/config.php.dist
+++ b/data/config.php.dist
@@ -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
diff --git a/src/phinde/Elasticsearch.php b/src/phinde/Elasticsearch.php
index 4035861..c437036 100644
--- a/src/phinde/Elasticsearch.php
+++ b/src/phinde/Elasticsearch.php
@@ -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,
),
)
),