Pager Control - Search Results Count

I can not figure out a way get the # of documents returned from a search on a view listed in an xpage? It appears the pager control has no ability to show this. Based on the thread listed below about no last page option - my guess is this is not included for performance reasons.

The results count is a rather basic feature of any search. Hopefully I’m just missing something here.

Any guidance is much appreciated!

http://www-10.lotus.com/ldd/nd85forum.nsf/5f27803bba85d8e285256bf10054620d/63f0e228e9345ebe852575380003a4f7?OpenDocument

Subject: The Solution

I found the secret. The computed field displaying the search count must physically be after the pager control (or repeat tag). If the computed field is before the pager control - it will show the count before the search was applied.

I also found that if you place a repeat control before the computed field, it will compute correctly. Since I don’t want a pager on this implementation - I used this method instead. The repeat control doesn’t actually have to repeat any object. (I don’t want the computed field to be duplicated) But it seems to allow the computed field to get the correct count.

I wonder if there is a performance drain on having a 2nd repeat?

Subject: Have you tried “dominoView.getAllEntries().getCount()” to get the document count in the view?

as in

var ct = dominoView.getAllEntries().getCount();

ct + " documents found."

It’ll return the total number of docs in the view and it will also return the number of documents found in FTS. But I’m not sure if it’ll do the same for filtering

Subject: What database did you reference?

I was looking at your image and realized that somehow that did return a count. So I ran a test with the 8.5 discussion database and it does not return the ‘documents found’ tag when I run a search.

I also reviewed the code in the discussion database and could not find anywhere that would have done this.

Subject: Discussion database with Full Text Search

The example I used in the screenshot is the discussion template which has been indexed for full text search. And I used the Domino view’s data source to get the document count of the view - dominoView.getAllEntries().getCount()This works in my example for FTS (search property), but I don’t think it’ll work when view filtering (categoryFilter, keys, exactKeys properties) are used.

Also, it may not work too well if at all on a viewPanel control which can be quite restrictive.

Subject: Getting there

I was able to get it to work on the discussion database - now I just need to figure out how that is different then my setup. At first glance - I don’t see anything. Will post a response later when I figure it out. Thanks!

Subject: Returns Unfiltered Count

The getCount() returns the entire view count. It doesn’t change based on the search.

I had already tried the view.getCount(). I then tried your suggestion of view.getallentries().getCount() and it produces the same result.