improved search results infos with count exact match
This commit is contained in:
parent
fe8cb11378
commit
dc2b536be3
|
@ -127,6 +127,9 @@ class Base extends ControllerBase {
|
||||||
$this->results['nids'][] = $result->getField('nid')->getValues()[0];
|
$this->results['nids'][] = $result->getField('nid')->getValues()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->exactematch_count = count($this->results['nids']);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// OR QUERY
|
// OR QUERY
|
||||||
//
|
//
|
||||||
|
@ -243,7 +246,9 @@ class Base extends ControllerBase {
|
||||||
$resp['term'] = $this->term;
|
$resp['term'] = $this->term;
|
||||||
// $resp['count'] = $this->results->getResultCount();
|
// $resp['count'] = $this->results->getResultCount();
|
||||||
$resp['count'] = count($this->results['nids']);
|
$resp['count'] = count($this->results['nids']);
|
||||||
$resp['infos'] = t('The search found @count result(s) with keywords @keys.', array(
|
$resp['exactematch_count'] = $this->exactematch_count;
|
||||||
|
$resp['infos'] = t('The search found @exactmatchcount exact match result(s) for @count total result(s) with keywords @keys', array(
|
||||||
|
"@exactmatchcount" => $resp['exactematch_count'],
|
||||||
"@count" => $resp['count'],
|
"@count" => $resp['count'],
|
||||||
"@keys" => $this->keys
|
"@keys" => $this->keys
|
||||||
));
|
));
|
||||||
|
|
Loading…
Reference in New Issue