Our autoindexes are picking up duplicate contentIds where users have copied content items using the paste-as-link functionality.
Is there an equivalent to DISTINCT for JSR queries so that we can remove this duplication? Or is there another way around this?
It’s been a while since I did this, but I believe you will need to use additional identifier - folder ID.
Our query is
SELECT rx:sys_contentid, rx:sys_revision, rx:sys_folderid FROM rx:cuShortCourse ORDER BY rx:displaytitle
so it’s already specifying the folder.
Did a bit of searching and it seems that there isn’t a DISTINCT equivalent.
It appears that JCR-SQL2 which supports DISTINCT is not used at this time. I am curious if it will be in the future to allow the use of DISTINCT. Have you posed the question to support to see if they have any suggestions?
You could specify a folder path (if you are able)…That way at least only one item will show up. We currently have a bug (tech support is following up on this) where even after specifying the folder path, the link to the wrong item (item in the other folder) is generated.
This also brings up a point as to which item you want the link to point to…
Thanks for your suggestions.
Support’s response was to either further refine the query as jtendra suggested or to determine the uniqueness in the Velocity template itself.
We’ll probably look at the latter.