Hello Manohar reddy,
If you want to display that total number of results on your live site, you can place following code to your transformation:
<%# DataItemIndex == 0 ? "<p>Total results: " + DataItemCount + "</p>" : "" %>
If you really want to do this in the code then this information is available in the Search results control that is used in all smart search related web parts:
~\CMSModules\SmartSearch\Controls\SearchResults.ascx.cs
There is a method called Search() that contains the following code:
// Search
DataSet results = SearchHelper.Search(parameters);
int numberOfResults = parameters.NumberOfResults;
You can store this number to a cookie or a session whatever else and render it in your transformation.
Another possibility which should be possible is to get the number of search results with the following code:
Hashtable resultRows = RequestStockHelper.GetItem(SearchHelper.RESULTS_KEY) as Hashtable;int numberOfRows = resultRows.Count;
Best regards,
Jan Hermann