This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Feb 14, 2012, 5:08 PM
4 Posts

XPages and FT Searching

  • Category: Performance
  • Platform: Windows
  • Release: 8.5.2
  • Role: End user,Developer
  • Tags: FullText Search XPages
  • Replies: 1
Maybe i am doing something wrong, but I am trying to do a full-text search on the web within an xpage/repeat control and the search either fails or just takes forever, but if I do that same search from within the view on the notes client it comes back really quickly.
 
Is it because I am using the view entry element (see code below)? Is there a better way to do this?
 
I am doing the array, to make counting, averaging and totaling easier (at least I think), as well as being able to sort on last name. Which is the most important part to this view, so if there is another way to do it then please let me know.
 
The query string variable is created in the search button which in return refreshes a panel, that contains the repeat control.
 
Any suggestions would be great, basically the performance is the issue. Funny thing is when I do the same kind of thing looping through a sql result set the performance is a lot quicker (one reason I tried to do it this way). Just makes no sense to me.
 
<< Here is my code in the repeat control >>
 
var search = sessionScope.get("queryString" );
var myview:NotesView = database.getView("vwPAQsGA_XP");
myview.clear();

if (search==""||search==null){
    myview.clear();    
}else{
    myview.FTSearch(search);    
}
var vec:NotesViewEntryCollection = myview.getAllEntries();

var arrayCount = new Array();
var arrayTotal = new Array();
arrayCount[0] = 0;
arrayCount[1] = 0;
arrayCount[2] = 0;
arrayCount[3] = 0;
arrayCount[4] = 0;
arrayCount[5] = 0;
arrayCount[6] = 0;

arrayTotal[0] = 0;
arrayTotal[1] = 0;
arrayTotal[2] = 0;
arrayTotal[3] = 0;
arrayTotal[4] = 0;
arrayTotal[5] = 0;
arrayTotal[6] = 0;

var nArray = new Array();     var nCount = 0;
var entry:NotesViewEntry = vec.getFirstEntry();

while (entry != null) {
    
    var oArray = new Array();
    var doc = entry.getDocument();
    
    oArray[0] = doc.getItemValueString("EE_LastNameTx");
    oArray[1] = doc.getItemValueString("EE_FirstNameTx");
    oArray[2] = doc.getItemValueString("CONameTx");
    oArray[3] = doc.getItemValueString("EE_PolicyLevelTx");
    oArray[4] = doc.getItemValueString("DB_RELOCOORDINATORNA");
    oArray[5] = doc.getItemValueString("DB_EXPENSEANALYSTNA");
    oArray[6] = doc.getItemValueString("StatusTx");   
    
    oArray[7] = doc.getItemValue("EE_InitiationDateDt");
    oArray[8] = doc.getItemValue("EE_EffectiveDateDt");
    oArray[9] = doc.getItemValue("EE_PAQSentDt");
    oArray[10] = doc.getItemValue("PAQRemindersDt");
    oArray[11] = doc.getItemValue("EE_SubmittedDateDt");
    
   
    oArray[12] = doc.getItemValueString("EE_PAQSec1Avg");
    //var tmpVal = doc.getItemValueString("EE_PAQSec1Avg");
    performCount( doc.getItemValueString("EE_PAQSec1Avg"), 1 )
    
    oArray[13] = doc.getItemValueString("EE_PAQSec2Avg");
    performCount( doc.getItemValueString("EE_PAQSec2Avg"), 2 )
    
    oArray[14] = doc.getItemValueString("EE_PAQSec3Avg");
    performCount( doc.getItemValueString("EE_PAQSec3Avg"), 3 )
    
    oArray[15] = doc.getItemValueString("EE_PAQSec4Avg");
    performCount( doc.getItemValueString("EE_PAQSec4Avg"), 4 )
    
    oArray[16] = doc.getItemValueString("EE_PAQSec5Avg");
    performCount( doc.getItemValueString("EE_PAQSec5Avg"), 5 )
    
    oArray[17] = doc.getItemValueString("EE_PAQSec6Avg");
    performCount( doc.getItemValueString("EE_PAQSec6Avg"), 6 )
    
    oArray[18] = doc.getItemValueString("EE_PAQSecTotalAvg");
    performCount( doc.getItemValueString("EE_PAQSecTotalAvg"), 0 )
    
    var tmpentry:NotesViewEntry = vec.getNextEntry(entry);
    entry.recycle();
    entry = tmpentry;
    nArray[nCount] = oArray;
    nCount += 1;
}

sessionScope.put("theTotal", arrayTotal);
sessionScope.put("theCount", arrayCount );
nArray.sort();

Feb 14, 2012, 8:04 PM
261 Posts
Re: XPages and FT Searching
Anthony,
 
I'm using the same technique in an application I'm working on: perform the FT search and then parse the resultset to transform it into a Javascript array.
 
First step for your problem would be to figure out what part of your code is taking so much time. You can use my Xpage Debug Toolbar for that, but it's most likely the part where you loop through all the entries. The FT search itself will probably only take a couple of milliseconds. The problem lies in all the .getItemValue calls you're performing: they take time and that quickly adds up for large resultsets.
 
There are some alternatives for reading the information from the document you might consider (I'm currently also testing a couple of options:
  • read the values from one or more view columns instead of the document.
  • store all the values you need from every document in a JSON object and serialize it to a field when saving a document (using the fromJson and toJson methods): that way you only need to perform one read action from a view column/ the document.

Mark


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal