ezsystems/ezpublish-kernel — pull request #553 by pspanja (2013-10-08 18:37:49+00:00)
Title: Fix EZP-21700: Search API returning duplicate content ids

This PR resolves issue https://jira.ez.no/browse/EZP-21700

Using Search with Field SortClause was producing duplicate Content ids when Content existed in multiple languages.
Field values are stored in separate row for each language, because of this `JOIN` produced multiple rows for the same Content. Therefore using sort on a Field value makes no sense without language information.

The problem is fixed by introducing $langaugeCode parameter for Field SortClause and using it for joining with `ezcontentobject_attribute` table.

Note that it is possible to use multiple sort clauses with different language on a same Field.