Tuesday, December 1, 2015

Strange/Unexpected/Frustrating in-place search Issue with SharePoint 2013

I am going to talk about poorly documented feature of SharePoint – the in-place search. Some of you may have already used it but you never realized that an official name for that is "in-place" search. Yes, I'm talking about that little search box appearing in document libraries and list, which allows you to search within current document library or list.

One of our clients reported a weird and very annoying issues while using that in-pace search. Examples below:

1. When I search for a word (say rate), it does not display documents which has "rate" as in title or name

2. When two different people who have been using the system for a while performs same keyword search they see different results even though they both have exact permissions

3. When I search for Title:rate, the documents containing word "rate" in title appears correctly. Then why not in case of #1 above?

4. When I search for word "rate" in regular search it shows the document containing the word risk in title. Then question is does in-place search use search engine internally?

5. Following message pops up randomly below the results:

Some files might be hidden. Include these in your search

When I fire up a query in regular search, the results are ranked and all documents are returned as expected – so there is absolutely no issue in crawling or querying components of search in general. The results of in-place search returned items for which the term was inside the content of files, so it's definitely using search component internally.

What's happening here? The issue was so embarrassing and annoying, for few hours I had absolutely no idea what was going on. We did not customize anything, so I believed strongly that there is some problem in SharePoint implementation or its by design. Regardless of the reason, it was unacceptable.

So I started digging deeper into it by opening SharePoint Assemblies in ILSpy and figured out following disturbing facts which are not so well explained anywhere!

1. That the in-place search would never return more than 500 results even though search would have returned more than 500.

2. It limits the results to current document library by appending "path:{{Root Folder Path of Document Lib/List}} AND {{query term}}"

3. It will ignore the result types and query rules.

4. While using search component, it looks for ID of the list items and path of the items

5. Another query is then generated to get all the fields that the Library/List view is expecting.  THIS IS THE WORST PART.  The first problem is the Performance. You clearly see that after search has returned items, SharePoint is still trying to query the list and get the corresponding list items. The worst of all is that during this process, it hits the 5000 threshold and it never returns the full results that search returned.

6 If that was not enough, the results are sorted based on view's sorting order, regardless of the search ranking. For an end user this may not be a good experience because the documents containing the search word may not appear on first few pages or may not appear at all if the document library has more than 5000 items.

So what are our options?

1. Ask client to increase threshold to match number of documents?

2. Ask clients to use more advanced search. Ask them to use FileExtension:docx or Title:Rate?

3. Suggest them not to use the in-place search?

4. Reorganize their libraries?

Should Microsoft feel proud about this in-place search?

I would love to find a working solution for this. Feel free to leave comments!

- See more at: https://bigapplesharepoint-public.sharepoint.com/pages/View-An-Insight.aspx?BlogID=120#sthash.3jjOreoa.dpuf

1 comment: