none
How to obtain the numbers of indexed items in SP from a web server?

    Question

  • Greetings,

    We have one SP for search 2013.  It is working fine.  Now we have a .NET dynamic website and would like to pull some reports from the Search server, such as numbers of index items .... I know that SharePoint web service would do the job but I don't know which one.  I got the WS list here:  http://msdn.microsoft.com/en-us/library/sharepoint/jj193051.aspx

    Is there a way?  

    Thanks

    john9569

    Tuesday, August 20, 2013 10:06 PM

Answers

All replies

  • There is no web service out of the box that exposes the number of indexed items. You will have to use the object model and expose your own web service and call that.

    Blog |SharePoint Field Notes Dev Tool | SPFastDeploy

    Tuesday, August 20, 2013 10:20 PM
  • THank you.  I guess I have to go that route.
    Tuesday, August 27, 2013 7:55 PM
  • Why not just literally request the search admin page in an HTTP request and read the response?  I think you'd just need your ASP.NET app pool account to have rights inside SP Search...

    Please mark my response as an answer if appropriate.
    Learn.SharePoint.com


    Tuesday, August 27, 2013 7:59 PM
  • Thank you for the hint.  I completely forget about reading the response from that HTTPs page.  However, one thing I am not certain (or never done that before) is using the so-called AppPool account.  I read this post and I still don't quite understand how I use it in the C# codes.   What is the Username/password when using this AppPool Acct?  For sure the Username would be:  myPoolName.  

    Do you have a sample codes somewhere which is using this special account to read the HTTP response?  I can't seem to bing/google it anywhere.

    Thanks for your help.

    Bests

    John9569

    Thursday, August 29, 2013 2:29 AM
  • hmm disregard that app pool stuff for now. Just create a new HTTPWebRequest and set the property UseDefaultCredentials to true and you should be good to get the page programmatically. If your web.config is configured in a default manner, you should not need to worry about the app pool account, as long as the account running the report (and hence making the HTTPWebRequest) has access to the SP search service pages.

    Please mark my response as an answer if appropriate.
    Learn.SharePoint.com

    Thursday, August 29, 2013 3:06 AM
  • Thanks for your quick response.  Interesting enough, I tried to view the source of that page, I am unable to find that count values anywhere....  (Right click on page and select View Source).  

    It is using AJAX to render that webpart but somehow, I can't still find that value anywhere in the view source....

    hahaha... I need help!  That drives me nut!  I need a break, I guess! :)

    Once again, thanks much for your help.

    Thursday, August 29, 2013 8:05 AM
  • Hi Steve,

    Thanks for sharing the information.

    Can you direct us which SharePoint API will help us to collect Indexed Item per day and for a week.

    Thanks in advance,

    AH


    Abu

    Wednesday, December 11, 2013 2:17 PM