couchapp - CouchDB-Lucene index function doesn't work with external code -


i'm using couchdb-lucene retrieving data of tables in database. thing have parse data know ones want put in lucene index.

so, thought use class wrote process data. , use couchapp directives add class in index function.

the result looks this:

//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 

when @ design document, seems code correctly added, when execute search, lucene says "myclass not defined".

if try copy/paste "myclass" code manually (and therefore no longer using couchapp directive), lucene says document has incorrect ending.

what missing?


edit: removed real function code has no point in issue.

is !vendor inlining myclass code "index" value?

the error got when included myclass code directly sounds javascript error of own. couchdb-lucene evaluates string use rhino full javascript engine.

perhaps if include full "index" value more obvious.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -