Skip to content

OBGM-506 Fix search bar on product list page#4102

Merged
kchelstowski merged 1 commit intofeature/upgrade-to-grails-3.3.10from
OBGM-506
Jun 13, 2023
Merged

OBGM-506 Fix search bar on product list page#4102
kchelstowski merged 1 commit intofeature/upgrade-to-grails-3.3.10from
OBGM-506

Conversation

@kchelstowski
Copy link
Collaborator

No description provided.

Comment on lines +333 to +334
createAlias("synonyms", "synonym", JoinType.LEFT_OUTER_JOIN)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alannadolny no, it is not applied only if isCountQuery is false. The createAlias is applied after this if/else statement:
Screenshot from 2023-06-13 12-57-32

Copy link
Collaborator Author

@kchelstowski kchelstowski Jun 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator Author

@kchelstowski kchelstowski Jun 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additionally the listDistinct never worked fine with the pagination, so I guess it wouldn't be achievable in an easy way

@kchelstowski kchelstowski merged commit d05e7f7 into feature/upgrade-to-grails-3.3.10 Jun 13, 2023
@kchelstowski kchelstowski deleted the OBGM-506 branch June 13, 2023 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants