AnsweredAssumed Answered

Lucene query OK in node browser but returns none in JS

Question asked by chapeaurouge on Aug 23, 2010
Latest reply on Aug 24, 2010 by chapeaurouge
Hello all,

I have a lucene query which works fine when used with the Node Browser. However, when used in the controller .js of my webscript, I get 0 result.

Here is the query (using some of my custom types):
TYPE:"{http://intranet/model/content/mysys/1.0}statements" +@\{http\://intranet/model/content/mysys/1.0\}db_source:"PROD"  +@\{http\://\}modified:[NOW TO NOW]

Here is the javascript:
function do_count() {

   var alfQry = 'TYPE:"{http://intranet/model/content/mysys/1.0}statements" +@\{http\://intranet/model/content/mysys/1.0\}db_source:"PROD"   +@\{http\://\}modified:[NOW TO NOW]';

   var encodedQry = search.ISO9075Encode(alfQry);

  var qryDefinition = {
     query: encodedQry,
     language: "lucene"
  var nodes = search.query(qryDefinition);
  logger.log("Number of nodes returned: " + nodes.length);
  return nodes.length;

Any idea?