Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

TypeError when creating lucene document #40

Closed
marcosvm opened this issue Jan 8, 2010 · 6 comments
Closed

TypeError when creating lucene document #40

marcosvm opened this issue Jan 8, 2010 · 6 comments

Comments

@marcosvm
Copy link

marcosvm commented Jan 8, 2010

Hi,

I'm using couchdb-lucene 0.5 as of today (01-07-2010) and couchdb 0.10.

When couchdb-lucene is indexing my documents, during the first access of the view I'm getting a TypeError exception that's preventing the document to be indexed:

2010-01-07 23:45:08,859 WARN couchdb.lucene.ViewIndexer.localhost/5984/knownet/bag/knsearch 16bb3f66e8d4c88d11b4e5c092ba38ab caused TypeError: Cannot find default value for object. (unnamed script#37)

I modified the DocumentConverterTest.java class to using my documents and my functions and the exception is still being thrown:

marcosvm@pepita:~/Servers/couchdb-lucene-0.5-SNAPSHOT $ jruby document_converter_test.rb
Loaded suite document_converter_test
Started
E
Finished in 0.258 seconds.

  1. Error:
    test_document_conversion(DocumentConverterTest):
    NativeException: org.mozilla.javascript.EcmaError: TypeError: Cannot find default value for object. (single#49)
    org/mozilla/javascript/ScriptRuntime.java:3654:in constructError' org/mozilla/javascript/ScriptRuntime.java:3632:inconstructError'
    org/mozilla/javascript/ScriptRuntime.java:3660:in typeError' org/mozilla/javascript/ScriptRuntime.java:3672:intypeError1'
    org/mozilla/javascript/ScriptableObject.java:781:in getDefaultValue' org/mozilla/javascript/ScriptableObject.java:700:ingetDefaultValue'
    org/mozilla/javascript/ScriptRuntime.java:724:in toString' org/mozilla/javascript/ScriptRuntime.java:3741:innotFunctionError'
    org/mozilla/javascript/ScriptRuntime.java:2247:in getPropFunctionAndThisHelper' org/mozilla/javascript/ScriptRuntime.java:2214:ingetPropFunctionAndThis'
    org/mozilla/javascript/gen/single:49:in _c0' org/mozilla/javascript/gen/single:-1:incall'
    org/mozilla/javascript/ContextFactory.java:398:in doTopCall' org/mozilla/javascript/ScriptRuntime.java:3065:indoTopCall'
    org/mozilla/javascript/gen/single:-1:in call' com/github/rnewson/couchdb/lucene/DocumentConverter.java:59:inconvert'
    document_converter_test.rb:23:in `test_document_conversion'

1 tests, 0 assertions, 0 failures, 1 errors

I'm not sure how to provide this default value required by Rhino or if it's an actual bug during the document conversion.

I put a copy of the function and one document here: http://gist.github.com/271912

Any help would be appreciated.

Thanks is advance,
Marcos

@rnewson
Copy link
Owner

rnewson commented Jan 8, 2010

I think it's a bug in your function but I can't see it. Rhino doesn't need any default values injected, so it's probably an obscurly reported Javascript problem.

@marcosvm
Copy link
Author

marcosvm commented Jan 8, 2010

I'll investigate further and let you know if I find out. Thank you for your reply.

@eee-c
Copy link

eee-c commented Feb 8, 2010

Dunno if it's the same thing, but I got this error when treating an array attribute as an Array (by calling join on it): http://japhr.blogspot.com/2010/02/weird-little-couchdb-lucene-bug.html

I have a workaround, but hopefully this might help to resolve.

@rnewson
Copy link
Owner

rnewson commented Feb 8, 2010

hi, I believe this is now fixed. The issue was in the conversion code.

@eee-c
Copy link

eee-c commented Feb 9, 2010

Dunno if that addressed the issue for the OP, but that resolved the TypeError issue for me, thanks!

@rnewson
Copy link
Owner

rnewson commented Apr 12, 2010

resolved in 0.5

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants