incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Wolff <awo...@gmail.com>
Subject Re: lucene error
Date Thu, 24 Sep 2009 19:48:12 GMT
@foo is an XML attribute in rhino. Crummy E4X syntax.
A

On Thu, Sep 24, 2009 at 10:38 AM, Paul Davis <paul.joseph.davis@gmail.com>wrote:

> This is interesting, and I found it quite by accident. I just opened a
> js shell to check the foo.@value syntax thinking that the @value
> wouldn't be a valid property name.
>
> $ js
> js> f = {}
> [object Object]
> js> f.@value = 2;
> 2
>
> Which looks ok, but the first shell I actually tried did this:
>
> $ js
> Rhino 1.7 release 1 2008 11 26
> js> f = {}
> [object Object]
> js> f.@value = 2;
> js: "<stdin>", line 3: uncaught JavaScript runtime exception:
> TypeError: [object Object] is not an xml object.
>         at <stdin>:3
>
> It would appear that on my Ubuntu machine the js shell is provided by
> Rhino which is what couchdb-lucene uses and the @value is invalid for
> normal objects.
>
> Weird...
>
> Paul Davis
>
>
> On Thu, Sep 24, 2009 at 1:28 PM, Michael McCaffrey
> <mmccaffrey@ittvis.com> wrote:
> > Yep, I stepped down into the source to see where it executes the
> function...
> >
> > Here's the fulltext function.
> >
> > I'm referencing these fields in _views functions without a problem.
> >
> >  "fulltext": {
> >      "by_description": {
> >      "defaults":
> >      {
> >        "store": "yes"
> >      },
> >      "index": "function(doc)
> >      {
> >      if (doc['type:Description']['type:LocalizedString'].@value)
> >      {
> >        var ret=new Document();
> >        ret.add(doc['type:Description']['type:LocalizedString'].@value);
> >        return ret;
> >      }
> >      }"
> >
> > -----Original Message-----
> > From: Robert Newson [mailto:robert.newson@gmail.com]
> > Sent: Thursday, September 24, 2009 11:13 AM
> > To: user@couchdb.apache.org
> > Subject: Re: lucene error
> >
> > The first thing I'd suspect is a Javascript syntax or runtime error in
> > your function (but, hey, I would say that, right?).
> >
> > This stack trace is at the point where user-entered data hits the
> > runway, as it were, so it's not so unreasonable. Perhaps you could
> > paste your fulltext function?
> >
> > B.
> >
> > On Thu, Sep 24, 2009 at 5:25 PM, Michael McCaffrey
> > <mmccaffrey@ittvis.com> wrote:
> >> Thought I'd throw this out here while I dig into the code...
> >>
> >>
> >>
> >> Any ideas why this is happening?
> >>
> >>
> >>
> >> I believe it is happening when the indices are being built for lucene.
> >> For instance, if I change a fulltext function, it happens when I save
> >> the document.
> >>
> >>
> >>
> >> 2009-09-24 10:47:37,744 [couchdb-lucene] WARN function raised exception
> >> (TypeError: [object Object] is not an xml object.) with
> >> 019266804cfd515842c1e73a77d6528d
> >>
> >> org.mozilla.javascript.EcmaError: TypeError: [object Object] is not an
> >> xml object.
> >>
> >>        at
> >> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3
> >> 557)
> >>
> >>        at
> >> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3
> >> 535)
> >>
> >>        at
> >> org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3563)
> >>
> >>        at
> >> org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3575)
> >>
> >>        at
> >> org.mozilla.javascript.ScriptRuntime.notXmlError(ScriptRuntime.java:3655
> >> )
> >>
> >>        at
> >> org.mozilla.javascript.ScriptRuntime.memberRef(ScriptRuntime.java:3733)
> >>
> >>        at org.mozilla.javascript.gen.c10._c0(userFun:0)
> >>
> >>        at org.mozilla.javascript.gen.c10.call(userFun)
> >>
> >>        at
> >> org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
> >>
> >>        at org.mozilla.javascript.gen.c11._c0(systemFun:0)
> >>
> >>        at org.mozilla.javascript.gen.c11.call(systemFun)
> >>
> >>        at
> >> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
> >>
> >>        at
> >> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003)
> >>
> >>        at org.mozilla.javascript.gen.c11.call(systemFun)
> >>
> >>        at com.github.rnewson.couchdb.lucene.Rhino.map(Rhino.java:107)
> >>
> >>        at
> >> com.github.rnewson.couchdb.lucene.Index$Indexer.updateDatabase(Index.jav
> >> a:267)
> >>
> >>        at
> >> com.github.rnewson.couchdb.lucene.Index$Indexer.updateIndex(Index.java:1
> >> 94)
> >>
> >>        at
> >> com.github.rnewson.couchdb.lucene.Index$Indexer.access$100(Index.java:51
> >> )
> >>
> >>        at com.github.rnewson.couchdb.lucene.Index.main(Index.java:347)
> >>
> >>        at com.github.rnewson.couchdb.lucene.Main.main(Main.java:33)
> >>
> >>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message