How to Search by Document ID in SharePoint
Introduction
Searching for files using the Document ID field in SharePoint can be challenging, especially when the ID contains hyphens (-). Hyphens are interpreted by SharePoint Search as a “NOT” operator, which can unintentionally exclude results and make it difficult to locate documents by their full ID.
Why Is This Happening?
The Document ID is a unique identifier for files, but by default, searching for an ID like M3DJHK53YMAX-2114042065-47 using the standard search box (with or without quotes) may not work as expected due to the hyphen’s special meaning in search queries.

Workarounds
1. Use the Managed Property
You can search directly against the managed property for Document ID, typically DlcDocId. For example:
DlcDocId:M3DJHK53YMAX-2114042065-47
This method works even when the ID contains hyphens.

2. Use Wildcards
If you’re unsure of the full ID or want to avoid the hyphen issue, try using wildcards (*) to replace characters before or after the hyphen:
M3DJHK53YMAX*2114042065*47
This retrieves files containing parts of the Document ID.

3. Use AND Operators
Alternatively, you can split the Document ID into segments and use the AND operator:
"MX86573" AND "1483201383" AND "1780"
This approach helps bypass the hyphen exclusion and still narrows down results.

Hyphens can not be removed from Document ID
There is no option to update Document ID format to remove hyphens. The only configuration is to update prefix.

Summary
- Use the managed property (
DlcDocId) for precise searches. - Wildcards and
ANDoperators can help work around hyphen issues. - Changing the Document ID format is not recommended for existing large libraries.