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
Post a Comment