Projections & Distinct results?

Topics: Core, Troubleshooting
Developer
Sep 16, 2012 at 11:26 PM

Perhaps somebody knows if and how it's possible to have a Query return a set of distinct results? I am using a custom filter that selects all content items by multiple taxonomy terms. If a content item has both term A and B, and I am selecting all content items with either term A or term B, then that content item shows up twice in the results.

The IHqlQuery doesn't seem to support for something like a DISTINCT operation, but perhaps there's another way?

Developer
Sep 16, 2012 at 11:53 PM

For now this is resolved by copying the ProjectionManager class into my own module and suppressing the one from the Projections module. The modified class applies the Distinct method on the resulting set of content items.

Although this works for me, I can imagine that always using Distinct does not work for everybody: maybe certain queries should allow for duplicate results.
Thoughts?