sp-dev-docs
sp-dev-docs copied to clipboard
Retrieve duplicate search results using the TrimDuplicatesIncludeId property - CollapseSpecification set to false doesn't work.
The documentation says:
Use TrimDuplicatesIncludeId to retrieve the duplicates of a document when TrimDuplicates is true and TrimDuplicatesOnProperty or CollapseSpecification is set to false.
It stopped working in SharePoint Online.
Now, you should use CollapseSpecification='DocumentSignature: 1'
to make it work.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: ec8602f3-35d6-27d4-cbb9-c4e5e25581a2
- Version Independent ID: d6db37b2-d279-9373-a2fa-a747a6ef0dc4
- Content: Customizing search results in SharePoint
- Content Source: docs/general-development/customizing-search-results-in-sharepoint.md
- Product: sharepoint
- Technology: sharepoint-framework
- GitHub Login: @spdevdocs
- Microsoft Alias: spdevdocs
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
@wobba Can you chime on on this? Are the docs incorrect and should be updated? If so, is this a unique setting in SPO vs. SP on-prem?
@karolikl And idea if there has been a change here? Docs state you can use TrimDuplicatesOnProperty
for backwards compat.
@AJIXuMuK I would change to collapsespec anyways, which has been the recommended approach for years.
@wobba just to clarify: CollapseSpecification = 'DocumentSignature: 1'
is the recommended approach?
Depends what you want to achieve. If you want all duplicates for a specific item I do not expect CollapseSpecification='DocumentSignature: 1'
to work as that will return one doc per signature.
And duplicate trimming on the default signature is also "evil", and we don't use in OOB Microsoft Search.
Can you clarify the issue a bit more?
I think perhaps the text "TrimDuplicatesOnProperty or CollapseSpecification is set to false." is wrong and should say "not set" instead of "false". Agree that that is the "bug"?
@wobba the use case is get duplicates for a single document, yes.
For that I was using CollapseSpecification=false
. And that worked. But stopped working in SPO probably few weeks ago (can't tell the exact timeframe).
After trying different combinations, setting CollapseSpecification='DocumentSignature: 1'
seems to work.
So, instead of
TrimDuplicatesIncludeId = <id>
CollapseSpecification = false
I have
TrimDuplicatesIncludeId = <id>
CollapseSpecification = 'DocumentSignature: 1'
If I leave CollapseSpecification
unset, it just returns the whole result set, without TrimDuplicatesIncludeId
filtering.
So, I would say, CollapseSpecification = false
should be changed to CollapseSpecification='DocumentSignature: 1'
in the docs.
Let me know if there is other approach I could use.
Afaik CollapseSpecification should never have a value of "false". I'll take a pass at proposing the proper change to the docs once I get it working. When I specify TrimDuplicates=true
and trimduplicatesincludeid=<id>
I would expect to get all duplicated + original of that one file.
Seems the setting to provide an id has no effect at all.
CollapseSpecification='DocumentSignature:1'
is the same as setting TrimDuplicates=true
. Keep one item when the signature matches. trimduplicatesincludeid
is about getting all the duplicates.
I tried in classic to enable Show View Duplicates link
but cannot see the link showing, so need to investigate a bit more.
Any update on this ?
@wobba When I specify TrimDuplicates=true and trimduplicatesincludeid=id I would expect to get all duplicated + original of that one file, but this is not happening, search result has no impact of trimduplicatesincludeid=id. I also tried providing CollapseSpecification='DocumentSignature:1' together with the above 2 properties but it has NO effects.
I don't see any update of this bug since 1 year. Is this bug is still not resolved?
@wobba At this time any mentioning of TrimDuplicatesIncludeId with value in search returns "An unknown error occurred."
Tried it on multiple production and demo tenants.
I don't have details but could be that TrimDuplicatesIncludeId
is deprecated without a message as it hasn't worked for long while.
@wobba Anyway to confirm this depreciation? We have a feature in our app that this relies on, and we would need to deprecate it in this case...
We are testing this internally and will share details when we have an ETA for production. Parameter is not deprecated.
We identified a case around TrimDuplicatesIncludeId
which we have to look closer into.
@wobba any news on the issue with TrimDuplicatesIncludeId? It is still not working...