I found the solution to my issue:
I have to put my external code INSIDE my index function:
//Index Function
function (doc) {
var myClass = new MyClass(doc.Data);
var ret = new Document();
ret.add(myClass.getResult());
return ret;
//CouchApp directives:
//! vendor/couchapp/MyClass.js
}
I don't know why it works without being inside the map function for a couchdb view, but it doesn't for a lucene index function.
Hope it helps! Regards, Mickaël