SP2013 - Querying a document based on its Item ID

Hi Search Enthusiasts !

For troubleshooting purpose, you might want to look at the MPs of a specific document or list item.

First you need to identify the internal document id also called the Item ID in the Crawl Log  (CA UI).


Once you have the id you're looking for, you may use the Search Query Tool (http://sp2013searchtool.codeplex.com/).

You can also determine that id out of a specific query results too.


You might think  we are dealing with the DocID MP, lets' review the DocId details.  

ID : DocId
PID : 171
SystemDefined : True
Name : DocId
SplitStringCharacters :
SplitStringOnSpace : False
Description :
ManagedType : Text
Searchable : False
FullTextQueriable : False
Queryable : True
Retrievable : True
Refinable : False
Sortable : False
FullTextIndex :
Context : 0
RefinerConfiguration :
SortableType : Enabled

However the DocId MP is actually reserved for the Document ID Service feature.

From an Item ID, to retrieve a specific document, use the below query


indexdocid is an internal field the query component is leveraging.


The UI of the Search Query is a bit confusing as it shows the indexerdocid as DocId. Don't get confused, the DocID shown is the Item ID of the Crawl Log UI.

Very simple trick but so useful to evaluate you MP mapping or troubleshooting differences between indexed documents.

To retrieve two documents

indexdocid:63 indexdocid:62


Et Voila !

Hope this could be of help. Stay Tuned.