OBGM-506 Fix search bar on product list page#4102
OBGM-506 Fix search bar on product list page#4102kchelstowski merged 1 commit intofeature/upgrade-to-grails-3.3.10from
Conversation
| createAlias("synonyms", "synonym", JoinType.LEFT_OUTER_JOIN) | ||
|
|
There was a problem hiding this comment.
I am curious if this query returns only unique rows. @jmiranda described this issue here: ticket
To clarify my previous comment what I meant was that the searchProducts method (in line 13) returns duplicate products because there’s no listDistinct on the query and a list query with left outer joins usually produces duplicate results.
I can see that there is setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY), but it is applied only if isCountQuery is false. I am not sure if this issue occurs here and how the solution will look like in this case.
There was a problem hiding this comment.
@alannadolny no, it is not applied only if isCountQuery is false. The createAlias is applied after this if/else statement:

There was a problem hiding this comment.
answering to "duplicate" part - I have not discovered it while testing + I think it would've been discovered earlier if those had appeared, because in Grails 1 we use the left outer join already
There was a problem hiding this comment.
additionally the listDistinct never worked fine with the pagination, so I guess it wouldn't be achievable in an easy way
No description provided.