Permalink
Browse files

Fixed #19081: problem with ezkeyword facet and returned matches

Previous fix was removed while fixing some regressions
  • Loading branch information...
1 parent 9527a8b commit ddf2b481fbebc484423e60146b9b0e75d479c629 @dpobel dpobel committed Jun 6, 2012
@@ -160,6 +160,7 @@ public function attribute( $attr )
'count' => count( $facetField ),
'nameList' => array(),
'queryLimit' => array(),
+ 'fieldList' => array(),
'countList' => array() );
foreach ( $facetField as $contentClassID => $count )
{
@@ -168,6 +169,7 @@ public function attribute( $attr )
$fieldInfo['nameList'][$contentClassID] = $contentClass->attribute( 'name' );
$fieldInfo['queryLimit'][$contentClassID] = 'contentclass_id:' . $contentClassID;
$fieldInfo['countList'][$contentClassID] = $count;
+ $fieldInfo['fieldList'][$contentClassID] = 'contentclass_id';
}
else
{
@@ -186,13 +188,15 @@ public function attribute( $attr )
'count' => count( $facetField ),
'nameList' => array(),
'queryLimit' => array(),
+ 'fieldList' => array(),
'countList' => array() );
foreach ( $facetField as $installationID => $count )
{
$fieldInfo['nameList'][$installationID] = isset( $siteNameMapList[$installationID] ) ?
$siteNameMapList[$installationID] : $installationID;
$fieldInfo['queryLimit'][$installationID] = 'installation_id:' . $installationID;
$fieldInfo['countList'][$installationID] = $count;
+ $fieldInfo['fieldList'][$installationID] = 'installation_id';
}
$facetArray[] = $fieldInfo;
} break;
@@ -204,6 +208,7 @@ public function attribute( $attr )
'count' => count( $facetField ),
'nameList' => array(),
'queryLimit' => array(),
+ 'fieldList' => array(),
'countList' => array() );
foreach ( $facetField as $ownerID => $count )
{
@@ -212,6 +217,7 @@ public function attribute( $attr )
$fieldInfo['nameList'][$ownerID] = $owner->attribute( 'name' );
$fieldInfo['queryLimit'][$ownerID] = 'owner_id:' . $ownerID;
$fieldInfo['countList'][$ownerID] = $count;
+ $fieldInfo['fieldList'][$ownerID] = 'owner_id';
}
else
{
@@ -228,11 +234,13 @@ public function attribute( $attr )
'count' => count( $facetField ),
'nameList' => array(),
'queryLimit' => array(),
+ 'fieldList' => array(),
'countList' => array() );
foreach ( $facetField as $languageCode => $count )
{
$fieldInfo['nameList'][$languageCode] = $languageCode;
$fieldInfo['queryLimit'][$languageCode] = 'language_code:' . $languageCode;
+ $fieldInfo['fieldList'][$languageCode] = 'language_code';
$fieldInfo['countList'][$languageCode] = $count;
}
$facetArray[] = $fieldInfo;
@@ -243,11 +251,13 @@ public function attribute( $attr )
$fieldInfo = array( 'field' => $attr,
'count' => count( $facetField ),
'queryLimit' => array(),
+ 'fieldList' => array(),
'nameList' => array(),
'countList' => array() );
foreach ( $facetField as $value => $count )
{
$fieldInfo['nameList'][$value] = $value;
+ $fieldInfo['fieldList'][$value] = $field;
$fieldInfo['queryLimit'][$value] = $field . ':' . $value;
$fieldInfo['countList'][$value] = $count;
}
@@ -207,7 +207,7 @@
{foreach $facetData.nameList as $key2 => $facetName}
{if eq( $activeFacetParameters[concat( $defaultFacet['field'], ':', $defaultFacet['name'] )], $facetName )}
{def $activeFacetsCount=sum( $key, 1 )}
- {def $suffix=$uriSuffix|explode( concat( '&filter[]=', $facetData.queryLimit[$key2]|solr_quotes_escape ) )|implode( '' )|explode( concat( '&activeFacets[', $defaultFacet['field'], ':', $defaultFacet['name'], ']=', $facetName ) )|implode( '' )}
+ {def $suffix=$uriSuffix|explode( concat( '&filter[]=', $facetData.fieldList[$key2], ':"', $key2|solr_quotes_escape, '"' ) )|implode( '' )|explode( concat( '&activeFacets[', $defaultFacet['field'], ':', $defaultFacet['name'], ']=', $facetName ) )|implode( '' )}
<li>
<a class="btn btn-mini" href={concat( $baseURI, $suffix )|ezurl} title="{'Remove filter on '|i18n( 'design/ezwebin/content/search' )}'{$facetName|trim('"')|wash}'">
<span class="remover">&times</span>
@@ -254,7 +254,7 @@
<li>
<span class="label facet-count">{$facetData.countList[$key2]}</span>
<a href={concat(
- $baseURI, '&filter[]=', $facetData.queryLimit[$key2]|solr_quotes_escape|rawurlencode,
+ $baseURI, '&filter[]=', $facetData.fieldList[$key2], ':"', $key2|solr_quotes_escape|rawurlencode, '"',
'&activeFacets[', $defaultFacet['field'], ':', $defaultFacet['name'], ']=',
$facetName|rawurlencode,
$uriSuffix )|ezurl}>
@@ -209,7 +209,7 @@
{foreach $facetData.nameList as $key2 => $facetName}
{if eq( $activeFacetParameters[concat( $defaultFacet['field'], ':', $defaultFacet['name'] )], $facetName )}
{set $activeFacetsCount=sum( $key, 1 )}
- {def $suffix=$uriSuffix|explode( concat( '&filter[]=', $facetData.queryLimit[$key2]|solr_quotes_escape ) )|implode( '' )|explode( concat( '&activeFacets[', $defaultFacet['field'], ':', $defaultFacet['name'], ']=', $facetName ) )|implode( '' )}
+ {def $suffix=$uriSuffix|explode( concat( '&filter[]=', $facetData.fieldList[$key2], ':"', $key2|solr_quotes_escape, '"' ) )|implode( '' )|explode( concat( '&activeFacets[', $defaultFacet['field'], ':', $defaultFacet['name'], ']=', $facetName ) )|implode( '' )}
<li>
<a href={concat( $baseURI, $suffix )|ezurl}>[x]</a> <strong>{$defaultFacet['name']}</strong>: {$facetName|trim('"')|wash}
</li>
@@ -246,7 +246,7 @@
{if ne( $key2, '' )}
<li>
<a href={concat(
- $baseURI, '&filter[]=', $facetData.queryLimit[$key2]|solr_quotes_escape|rawurlencode,
+ $baseURI, '&filter[]=', $facetData.fieldList[$key2], ':"', $key2|solr_quotes_escape|rawurlencode, '"',
'&activeFacets[', $defaultFacet['field'], ':', $defaultFacet['name'], ']=',
$facetName|rawurlencode,
$uriSuffix )|ezurl}>

0 comments on commit ddf2b48

Please sign in to comment.