Getting Unique entries?
The query returned by buildElementsQuery() is already prepped to fetch unique entries. But it’s possible for two distinct entries to have the same title, which is why it may look like duplicate entries are being returned.

To only fetch entries with unique titles, do this:

$query-&gt;group('content.title');