Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22462

Search API: allow Searching on specific translations / LanguageCode

    XMLWordPrintable

Details

    Description

      It Should be possible to search content only on specific languages/translations.

      Simply adding a LanguageCode Criterion to the search does not allow for this, instead filtering on content which contains that translation.
      In the following example, the FullText returns results regardless of language:

      Take the following example command snippet:

              $query->criterion = new Criterion\LogicalAnd(
                  array(
                      new Criterion\FullText( $input->getArgument( 'search_text' ) ),
                      new Criterion\LanguageCode( $input->getArgument( 'language' ) ),
                  )
              );
              $result = $searchService->findContent( $query );
      
      Steps to reproduce:
      1. Create an article in English ('eng-GB') with content 'test',
      2. Create a translation in Portuguese ('por-PT') with content 'teste';
      3. Search for the word 'test' and language 'por-PT' : article is returned in the results.
      4. Search for the word 'teste' and language 'eng-GB' : article is returned in the results.

      FullText (and possibly other criterions) should allow specifying LanguageCode(s)

      Attachments

        Activity

          People

            Unassigned Unassigned
            joao.inacio-obsolete@ez.no Joao Inacio (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: