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 7, 2013, 7:06 PM
31 Posts

FullText query yielding no results

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role:
  • Tags: full text search,FullText Search XPages
  • Replies: 5
I am setting a viewScope variable for a full-text query against a view in a beforeRenderResponse. The query isn't yielding any results even though the same query in a Notes client view produce results. I have done this before and it works fine so I can't figure out the issues here.
 
The query looks right in my print statement and I have also ensured that I am yielding numbers for the viewScope.det since 'details' will be a number field in the document.
 
viewScope.put('viewName', '(xpPartDetailView)');
viewScope.put('user', session.getEffectiveUserName());
var AE = @Name('[CN]', viewScope.user);
if (viewScope.det == null){viewScope.det = @Integer("2013");};
var details = viewScope.det;
var query = 'FIELD AccountExec contains ' + AE + ' AND FiscalYear is equal to ' + details;
print (query);
viewScope.put('query', query);
 
Thanks in advance,
Kendra
Feb 8, 2013, 4:17 AM
366 Posts
Re: FullText query yielding no results
 what happens if you change the view scope to session scope.
 
Just trying to make sure you are not running into a view scope issue and the event you chose. 
 
See if it works with a session scope 
Feb 9, 2013, 7:36 AM
14 Posts
Re: FullText query yielding no results
I'm missing quotes around AE and the hint that FiscalYear is a field.
My query would look like this:
var query = '[AccountExec]="' + AE + '" & [FiscalYear]=' + details; 
Feb 11, 2013, 3:46 PM
31 Posts
Re: FullText query yielding no results
My original post code works fine on every other instance - but I went ahead and tried changing viewScope to requestScope - no dice.
 
The only thing that is different in this instance as opposed to other times I have used this code is the "details" field is a number field while any other time it has been text. So is there some caveat to mixing text and numbers in a full-text search in this way?
Feb 11, 2013, 4:13 PM
31 Posts
Re: FullText query yielding no results
I did some more testing and also did a face palm - ARGHH!
 
The fields must all be text it looks like. But I also was missing "FIELD" for my FiscalYear search.
 var query = 'FIELD AccountExec contains ' + AE + ' AND FIELD FiscalYear is equal to ' + details;
 
 
When I added that FIELD - there is a handy error :
 
Exception: Exception occurred calling method NotesView.FTSearch(java.lang.String) null
 
This is what leads me to believe it has to all be text? 
 
Can anyone confirm?
Feb 12, 2013, 6:32 AM
14 Posts
Re: FullText query yielding no results
The queryString has to be text, of course.
 
But you can search for Strings (inside quotes), numbers or dates.
Searching for dates is a bit tricky, because you never know which part the server will interpret as month or day...
 
Simply manually enter your query in the Notes client's search bar. If it works, it should work from XPages, too.

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