Rank Detail not appearing

Oct 10, 2014 at 7:48 PM
Hi, I just got the SharePoint 2013 Search Query Tool, and I really like it so far. I was very interested in the rank detail information and I am not seeing that appear in my results after choosing the "include rank detail" checkbox. I thought maybe I wasn't doing something correctly or perhaps this works for specific scenarios. Any info you can provide about proper use of this feature would be much appreciated.
Thanks!
Brian
Oct 10, 2014 at 8:52 PM
Hey Brian,

Is there something in the "RAW" tab like:
{"error":{"code":"-1, Microsoft.Office.Server.Search.REST.SearchServiceException","message":{"lang":"de-DE","value":"Must be admin to run RankDetail queries"}}}

Cheers
Max
Oct 11, 2014 at 3:34 AM
I did not find any errors in the RAW tab... pasted everything to word and did a ctrl + F, but no matches on the word error. I should have site collection admin rights across the farm. Here is what I have on the RAW tab, is there something else I can look for? Thanks!

Response:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
X-SharePointHealthScore: 0
SPClientServiceRequestDuration: 157
SPRequestGuid: 78f3c09c-5169-d06e-2dac-8c202aac0e62
request-id: 78f3c09c-5169-d06e-2dac-8c202aac0e62
X-FRAME-OPTIONS: SAMEORIGIN
MicrosoftSharePointTeamServices: 15.0.0.4481
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
Persistent-Auth: true
Cache-Control: private, max-age=0
Content-Type: application/json;odata=verbose;charset=utf-8
Date: Sat, 11 Oct 2014 02:30:08 GMT
Expires: Fri, 26 Sep 2014 02:30:08 GMT
Last-Modified: Sat, 11 Oct 2014 02:30:08 GMT
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET

{"d":{"query":{"__metadata":{"type":"Microsoft.Office.Server.Search.REST.SearchResult"},"ElapsedTime":140,"PrimaryQueryResult":{"__metadata":{"type":"Microsoft.Office.Server.Search.REST.QueryResult"},"CustomResults":null,"QueryId":"a0399f44-9521-45e3-95ce-ba7a63c45bea","QueryRuleId":"00000000-0000-0000-0000-000000000000","RefinementResults":null,"RelevantResults":{"__metadata":{"type":"Microsoft.Office.Server.Search.REST.RelevantResults"},"GroupTemplateId":null,"ItemTemplateId":null,"Properties":{"results":[{"__metadata":{"type":"SP.KeyValue"},"Key":"GenerationId","Value":"9223372036854775806","ValueType":"Edm.Int64"},{"__metadata":{"type":"SP.KeyValue"},"Key":"ExecutionTimeMs","Value":"94","ValueType":"Edm.Int32"},{"__metadata":{"type":"SP.KeyValue"},"Key":"QueryModification","Value":"green book 2014 -ContentClass=urn:content-class:SPSPeople","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"RenderTemplateId","Value":"~sitecollection/_catalogs/masterpage/Display Templates/Search/Group_Default.js","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"piPageImpressionBlockType","Value":"2","ValueType":"Edm.Byte"},{"__metadata":{"type":"SP.KeyValue"},"Key":"StartRecord","Value":"0","ValueType":"Edm.Int32"},{"__metadata":{"type":"SP.KeyValue"},"Key":"IsLastBlockInSubstrate","Value":"true","ValueType":"Edm.Boolean"},{"__metadata":{"type":"SP.KeyValue"},"Key":"IsFirstBlockInSubstrate","Value":"false","ValueType":"Edm.Boolean"},{"__metadata":{"type":"SP.KeyValue"},"Key":"IsFirstPinnedResultBlock","Value":"false","ValueType":"Edm.Boolean"},{"__metadata":{"type":"SP.KeyValue"},"Key":"IsLastPinnedResultBlock","Value":"false","ValueType":"Edm.Boolean"},{"__metadata":{"type":"SP.KeyValue"},"Key":"IsFirstRankedResultBlock","Value":"true","ValueType":"Edm.Boolean"},{"__metadata":{"type":"SP.KeyValue"},"Key":"IsLastRankedResultBlock","Value":"true","ValueType":"Edm.Boolean"}]},"ResultTitle":null,"ResultTitleUrl":null,"RowCount":1,"Table":{"__metadata":{"type":"SP.SimpleDataTable"},"Rows":{"results":[{"__metadata":{"type":"SP.SimpleDataRow"},"Cells":{"results":[{"__metadata":{"type":"SP.KeyValue"},"Key":"Rank","Value":"25.0788097381592","ValueType":"Edm.Double"},{"__metadata":{"type":"SP.KeyValue"},"Key":"DocId","Value":"908165","ValueType":"Edm.Int64"},{"__metadata":{"type":"SP.KeyValue"},"Key":"rankdetail","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"title","Value":"BUSINESS OFFICE AND EMPLOYEE REPORTS 2014","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"path","Value":"https://tel.intranet.teldta.com/sites/no/Field_Services/Pages/BUSINESS-OFFICE-AND-EMPLOYEE-REPORTS-2014.aspx","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"language","Value":"en","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"OriginalPath","Value":"https://tel.intranet.teldta.com/sites/no/Field_Services/Pages/BUSINESS-OFFICE-AND-EMPLOYEE-REPORTS-2014.aspx","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"PartitionId","Value":"0c37852b-34d0-418e-91c6-2ac25af4be5b","ValueType":"Edm.Guid"},{"__metadata":{"type":"SP.KeyValue"},"Key":"UrlZone","Value":"0","ValueType":"Edm.Int32"},{"__metadata":{"type":"SP.KeyValue"},"Key":"AAMEnabledManagedProperties","Value":"AttachmentURI;deeplinks;DefaultEncodingURL;ExternalMediaURL;HierarchyUrl;OrgParentUrls;OrgUrls;OriginalPath;ParentLink;Path;PictureThumbnailURL;PictureURL;PublishingImage;recommendedfor;ServerRedirectedEmbedURL;ServerRedirectedPreviewURL;ServerRedirectedURL;SiteLogo;SitePath;SPSiteURL;UserEncodingURL","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"RenderTemplateId","Value":"~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Default.js","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"piSearchResultId","Value":"0_1","ValueType":"Edm.String"}]}}]}},"TotalRows":413,"TotalRowsIncludingDuplicates":413},"SpecialTermResults":null},"Properties":{"results":[{"__metadata":{"type":"SP.KeyValue"},"Key":"RowLimit","Value":"1","ValueType":"Edm.Int32"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SourceId","Value":"8413cd39-2156-4e00-b54d-11efd9abdb89","ValueType":"Edm.Guid"},{"__metadata":{"type":"SP.KeyValue"},"Key":"EnableInterleaving","Value":"true","ValueType":"Edm.Boolean"},{"__metadata":{"type":"SP.KeyValue"},"Key":"BlockRankLog","Value":"No interleaving blocks\r\nDeduped 0 results due to pinned results\r\nNo blocks with available results to interleave\r\n","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"piPageImpression","Value":"359480_3880_1033","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SerializedQuery","Value":"<Query Culture=\"en-US\" EnableStemming=\"True\" EnablePhonetic=\"False\" EnableNicknames=\"False\" IgnoreAllNoiseQuery=\"True\" SummaryLength=\"180\" MaxSnippetLength=\"180\" DesiredSnippetLength=\"90\" KeywordInclusion=\"0\" QueryText=\"green book 2014\" QueryTemplate=\"\" TrimDuplicates=\"True\" Site=\"567a26c4-ff14-4684-a3f7-1c815381a7fa\" Web=\"49c8d7dc-ceec-47ba-8021-99dea12e3695\" KeywordType=\"True\" HiddenConstraints=\"\" />","ValueType":"Edm.String"}]},"SecondaryQueryResults":null,"SpellingSuggestion":"","TriggeredRules":{"results":[]}}}}
Oct 11, 2014 at 2:38 PM
Oct 13, 2014 at 2:58 PM
Edited Oct 14, 2014 at 4:49 PM
I'll give it a shot. Unfortunately, it looks like I am unable to get to that link to the complete template that was on pastebin. I am new at this, so it might take a while to get the template right.

I made a couple of edits to the following info after some additional troubleshooting:

In our production farm, I can see the rank detail intermittently. I thought it might depend on the location of the item in certain sites or collections, but I found that sometimes the rank detail is available when I use one query term, but not when I query on another term. In this case, the same result was at the top of the list, but after one query, everything has the rank detail available, and on a different query, nothing has the rank detail available.

It is consistent for each query, so everytime I search on x, I have no rank details available, but each time I search y, they are available even for a result item that appears in both queries. Based on that behavior, it looks like it isn't permissions related.

EDIT: the query I needed to troubleshoot was "green book". When I queried "green NEAR book" the rank details are available, but not available when just searching "green book". Strange, but I was able to get the info I need for this one. Any idea why that would happen, or is there something I should be doing differently?

Any other suggestions for things I can try are appreciated.

Thanks!
Dec 16, 2014 at 3:09 PM
Hy,
I had the same issue, and now i found out the reason why:

If the query Returns more than 100 items, "rankdetails" is empty. Don´t know why, but it is as simple as that. I guess in your case "green book" returned more than 100 items, while "grean NEAR book" didn´t.

I guess it is a "Feature" from the MS Search API.

However, it you use "Include Rank Detail" the (experimental) Feature "View all properties" results in a Crash of the whole application. Maybe the dev´s could look for this issue

btw:
MANY MANY thanks for the "View all properties"-Feature. How could I have been living without that g. It will be getting THE killer-Feature of the query tool
Marked as answer by Wobba on 12/17/2014 at 12:39 PM
Dec 17, 2014 at 8:39 PM
Poidl wrote:
Hy,
I had the same issue, and now i found out the reason why:

If the query Returns more than 100 items, "rankdetails" is empty. Don´t know why, but it is as simple as that. I guess in your case "green book" returned more than 100 items, while "grean NEAR book" didn´t.

I guess it is a "Feature" from the MS Search API.

However, it you use "Include Rank Detail" the (experimental) Feature "View all properties" results in a Crash of the whole application. Maybe the dev´s could look for this issue

btw:
MANY MANY thanks for the "View all properties"-Feature. How could I have been living without that g. It will be getting THE killer-Feature of the query tool
What's the scenario with the crash? If you have more than 100, and click the view all? And should be an easy fix.
Dec 30, 2014 at 7:03 PM
The scenario is to get rank details when you have more than 100 results, right?
I just tried it myself and Poidl is right - more than 100 results and rankdetail is empty. I think this is a performance optimization of the search engine.
  1. I added a tooltip to the checkbox and a status message if you exceed 100 results.
  2. I added the required workid property to the select properties when you click on Include Rankdetail.
Poidl: Thanks for your feedback! I love the feature, too.

Image

Cheers
Max
Jan 8, 2015 at 9:09 AM
I have added code which will give you details even though the result set is more than 100 items. It will perform one more query limiting to that item only.