Share via


Sharepoint Online: Searching for files and items using ID does not return expected results

There are times when you may observe different behavior when searching for an item or file in list/library by ID.

Scenario 1: Recently we noticed that when we try to search for an item/document using the ID it no longer returns any results, or the results do not include the item/document with that ID as part of the result set.

Scenario 2: We have two tenants (one for production and one for testing) that are seeing different behavior when searching for the ID of a document or list item. In one tenant when we try to search for an item/document using the ID it no longer returns any results whereas in the other tenant when search for an item/document with just the ID the results will include the document.

In both scenarios discussed above, the documents/items are searchable when searching using the managed property explicitly. For Example: listitemid:6 

 Why is this occurring?

Older farms were configured so that farm schema (this is different from the tenant schema) had the ID included in the fulltext index. As a result, freeform search for the ID  within the list or library search would return results that included that item or file. This would occur even though the managed property for listitemid is not configured to have this as part of the fulltext index at the tenant level.

[caption id="attachment_695" align="alignnone" width="400"] Tenant Level Configuration[/caption]

The farm level configuration that was present previously has been changed on newer farms for the following reasons:  performance improvements and feedback from customers that this configuration resulted in unexpected results. The farm schema no longer adds the ID to the fulltext index so users will need to explicitly search using the managed property listitemid:<ID> . As tenants are moved from one farm to another farm as part of planned capacity operations, you will experience scenario 1.  For scenario 2, this is due to one tenant being on an older farm where it is part of the fullindex in the farm schema and the other being on a newer farm where that is no longer in place.

How can I search for my list item without having to specify the listitemid managed property?

If you would like to return the ID without explicitly using the managed property you can take the following steps.

Note: We recommend making the Managed Properties that you are going to use on more than one site at the Tenant level as a best practice.

**After this change you may get unexpected result when performing numeric searches.

  1. Go to the SharePoint Admin center.
  2. Go to search
  3. Go to Manage search schema
  4. Click on “Create a new managed property”
  5. Give it a name and make sure that the following options are checked: Searchable, Queryable, Retrievable, Token Normalization
  6. Add a mapping to the ows_ListItemID
  7. Save.

 

Once you have completed these steps you will need to re-index the site collections/list/library: Manually request crawling and re-indexing of a site a library or a list. After content is re-indexed you will be able to search without explicitly using the managed property.

If you have any feedback or suggestions for search, please submit those suggestions to https://sharepoint.uservoice.com . The Product Group checks the requests and feedback on a regular basis and uses this feedback for new features and enhancements to the product.

Author: Tania Menice [MSFT]

Contributors: Paul Haskew[MSFT], Sridhar Narra [MSFT]