Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using MOSS 2007 to provide a custom search results page.

I need to display a number as part of search results which indicates the number that result appears in the whole result set.

The problem is that the XML returned by search does not contain data pertaining to the page (of results) that you are on.

I can use the value of 'id' but this only works if I do not use paged results (not ideal) because the id of the first result on the next page will revert to 1 again.

Has anyone had to address this before? Any XSLT magic I can use? Is there an additional field I can add into the search results to enable this?

share|improve this question
add comment

1 Answer

Its been a while since i looked at this, but isnt that what the ID element in the returned XML is there for?

<All_Results>
  <Result>
    <id>1</id> 
    <rank>713</rank> 
    <title>Microsoft.SharePoint Namespace</title> 
    <author /> 
    <size>39058</size> 
    ...

Check the reference here:

http://msdn.microsoft.com/en-us/library/ms584121(office.12).aspx

share|improve this answer
    
Is that what the "Rank" value is for? I cannot seem to find a schema definition so I cannot validate. –  Mike Oryszak Jul 17 '10 at 21:37
    
Anders, the id element will give you the number in the current page of results. Move to page 2 and the first item is id 1 again. Useful isn't it! –  Charles Lee Jul 20 '10 at 7:39
    
ahh yeah i thought there was something fishy. You do have the page count though in query string (start1 in WSS), so you could use the two combined to get an id i guess. –  Anders Rask Jul 20 '10 at 17:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.