1
Database db = Factory.getSession().getCurrentDatabase();
View view = db.getView("people");

//Returns the total number of entries e.g. 100
System.out.println( view.getEntryCount() ); 

//Filters the view so it represents only those documents that match the query
view.FTSearch("[lasteName] = \"Lynn\"");

//Returns the correct filtered number e.g. 30
System.out.println( view.getEntryCount() );     

//Create a ViewNavigator based on the filtered view.        
ViewNavigator nav = view.createViewNav();

//Unfortunately, it returns the original 100 instead of 30
System.out.println( nav.getCount() );

The example above illustrates that, when creating a ViewNavigator instance on a filtered (FTSearched) view, the original view data is used and not the filtered view one. Can anyone explain why this happens? Or clarify some (basic) underlying mechanism?

Dalie
  • 626
  • 1
  • 7
  • 19
  • 1
    RTFM: http://cclnprod.cc.nih.gov/help/help85_designer.nsf/f4b82fbb75e942a6852566ac0037f284/b8370d81a6e28c1685257607005fc94c ;-) I guess it's a limitation on the ViewNavigator. – Mark Leusink Nov 17 '15 at 20:35

1 Answers1

1

Don't use viewnavigator, filter your view and then use getAllEntries() to get a ViewEntryCollection

Howard

Howard
  • 1,503
  • 7
  • 16