eZ Community » Forums » eZ Publish 5 Platform » eZFind language filter
expandshrink

eZFind language filter

eZFind language filter

Monday 12 October 2015 1:59:38 pm - 3 replies

Hello,

How can i filter only in a specified languague with ezfind on Ez Publish 5 ( eZFunctionHandler::execute(                    'ezfind'....)?

I tried this :

[LanguageSearch]

SearchMainLanguageOnly=enabled

But it still return all the languages in my differents sites access.

Thank you for your help.

Monday 12 October 2015 3:45:05 pm

Hello,

I have the same problem.

Solr language search filter is calculated according to "site.ini > RegionalSettings > SiteLanguageList" when "SearchMainLanguageOnly" is "enabled".

It's ok when you are running in the context of a siteaccess because the right INI conf is loaded. But, when you are out of a siteaccess or cannot change the siteaccess you are running in, it's impossible to set the language of your search.

An issue is open : https://jira.ez.no/browse/EZP-22883

If you anyone has a solution, he would be glad to help.

Tuesday 13 October 2015 11:34:57 pm

How do you call ez find?

If you wrap the fetch function, it is likely a matter of adding a language filter query (a raw filter, like 'meta_language_code_ms:eng-GB')

hth

Paul

Friday 23 October 2015 12:30:11 pm

Yep,

I hacked the "ezfeZPSolrQueryBuilder" class to add a 'Language' param to "buildSearch" method :

public function buildSearch( $searchText, $params = array(), $searchTypes = array() )
{
    // ...    
    $LanguageParam = isset( $params['Language'] ) ? $params['Language'] : false;

This param is used to set up a language filter in "buildLanguageFilterQuery" method as you mentioned :

protected function buildLanguageFilterQuery( $locale = false )
{
    if ($locale) {
        $languageFilterString = $languageCodeMetaName . ':' . $locale;
    }
    elseif (  $searchMainLanguageOnly )
    ...
expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from