cancel
Showing results for 
Search instead for 
Did you mean: 

lucendSearch against properties

boneill
Star Contributor
Star Contributor
Hi all,

I am trying to run a websript that has a luceneSearch in it.  Its pretty simple, it searches a single property that has been attached to images in the AVM as an aspect.  It keeps returning no results although the same query works fine in the nodebrowser lucene search.  I call it using url:  http://localhost:8080/alfresco/service/image/search?s=test.  Firstly can I use the javascript lucene search to query AVM nodes with apects attached.  All the doco seems to point that its fine.  Secondly, have I got the lucene query string wrong?  All help really appreciated.

// store and path provided as args 

if (args.s == null || args.s.length == 0) {

   status.code = 400;

   status.message = "Store is a required argument.";

   status.redirect = true;

}



var store = avm.lookupStore(args.s);

if (store == null || store == undefined) {

   status.code = 404;

   status.message = "Store " + args.s + " not found.";

   status.redirect = true;

}



[b]var avmResults = store.luceneSearch("@sim\:description:purple");
model.resultset = avmResults;
[/b]
2 REPLIES 2

boneill
Star Contributor
Star Contributor
DOH, figured it out.  I needed to escape my search string for lucene query in the JS.  ie "tim\\:mypropertynameSmiley Tongueurple". 

Regards

nreau
Champ in-the-making
Champ in-the-making
You saved my day. Thank you for being came back and sharing your solution!