aboutsummaryrefslogtreecommitdiff
path: root/src/phinde
diff options
context:
space:
mode:
Diffstat (limited to 'src/phinde')
-rw-r--r--src/phinde/Elasticsearch.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/phinde/Elasticsearch.php b/src/phinde/Elasticsearch.php
index 310b63b..96a769b 100644
--- a/src/phinde/Elasticsearch.php
+++ b/src/phinde/Elasticsearch.php
@@ -70,6 +70,15 @@ class Elasticsearch
public function search($query, $filters, $site, $page, $perPage, $sort)
{
+ if (preg_match('#nick:([^ ]*)#', $query, $matches)) {
+ $authorName = $matches[1];
+ $query = str_replace(
+ 'nick:' . $authorName,
+ 'author.name:' . $authorName,
+ $query
+ );
+ }
+
if ($sort == 'date') {
$sortCfg = array('modate' => array('order' => 'desc'));
} else {