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



Mar 4, 2016, 2:27 PM
24 Posts

Type Ahead Search any word from 2 databases

  • Category: Server Side JavaScript
  • Platform: All
  • Release: All
  • Role: Developer
  • Tags:
  • Replies: 0

Hi

 

Last couple of weeks ago, I was working on a type ahead to get the full search in editbox if enter some part of the word

Like we have testing Lotus notes and administrating lotus notes, and in my type ahead if I write notes it will show be the keywords Lotus notes and administrating lotus notes.

For this I wrote or copied from the forum

var searchView:NotesView = session.getCurrentDatabase().getView("client")
var query = "(FIELD client CONTAINS *" + lupkey +"*)";
var searchOutput:Array = ["å","åå"];
var hits = searchView.FTSearch(query);
var entries = searchView.getAllEntries();
 var entry = entries.getFirstEntry();
 for (i=0; i<hits; i++) {
 searchOutput.push(entry.getColumnValues()[0]);
 entry = entries.getNextEntry();
var limitedSearchOutput = searchOutput.slice(0,Math.min(hits,20));

limitedSearchOutput = limitedSearchOutput.join("</li><li>").replace(eval("/"+@LowerCase(lupkey)+"/g"),"<b>"+@LowerCase(lupkey)+"</b>").replace(eval("/"+@ProperCase(lupkey)+"/g"),"<b>"+@ProperCase(lupkey)+"</b>");

return "<ul><li><span class='informal'>Suggestions:</span></li><li>" + limitedSearchOutput + "</li></ul>";
var limit = Math.min(hits,20);
 for (j=0; j<limit; j++) {
 var name = searchOutput[j].toString();
 var start = name.indexOfIgnoreCase(lupkey)
 var stop = start + lupkey.length;
name = name.insert("</b>",stop).insert("<b>",start);
 result += "<li>" + name + "</li>";
 }

 result += "</ul>";
 return result;

Now I want to use this type ahead from 2 databases, yes field name are same, they are the archive databases, Is it possible.This might be very interesting and use full  stuff for all of us.

Thanks and Regards

 

 


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