I'm trying to use a KeywordQuery to find a file's path from it's document ID (e.g. "F7YNH7UCH7KU-2102554853-454904"). I've tried using a QueryText using different variations of the document ID (e.g. "DocId", "_dlc_DocId", "ows_dlc_DocId", and "ows__dlc_DocId"), but none of them returned any results. In fact, SharePoint Online does not return any results when I perform a search from the search page and specify "DocId:xxx". When I use a QueryText of "ListItemID:xxx", I do get results, but I want to also retrieve the document ID so I can compare it to the one I am looking for. I've tried adding different properties to SelectProperties, but the fields returned are all blank. What am I doing wrong?
2 Answers
Most likely you have an issue mapping the crawled property to a managed property, as shown here https://richardstk.com/2014/12/12/search-by-document-id-in-sharepoint-2013/amp/