adeppathondur / luke

Automatically exported from code.google.com/p/luke
0 stars 0 forks source link

Error while using custom similarity #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. go to Search tab ->Similairty tab
2. Select Current custom similarity
3. Design... -> Load samples -> DefaulSimilarity.js ->Compile
4. Search Tab -> Search

What is the expected output? What do you see instead?

I see ERROR: searching: java.lang.ClassCastException: java.lang.Double can not 
be cast to 
org.apache.lucene.search.Explanation$IDFExplanation

What version of the product are you using? On what operating system?
running luke-1.0.1.jar compiled from source using svn revision 27.
Running on Mac, snow leopard

Please provide any additional information below.

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object org.apache.lucene.search.IndexSearcher@75f0f8ff 
of class 
org.apache.lucene.search.IndexSearcher where it expected String, Number, 
Boolean or Scriptable 
instance. Please check your code for missig Context.javaToJS() call.
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object contents:test of class 
org.apache.lucene.index.Term where it 
expected String, Number, Boolean or Scriptable instance. Please check your code 
for missig 
Context.javaToJS() call.
java.lang.ClassCastException: java.lang.Double cannot be cast to 
org.apache.lucene.search.Explanation$IDFExplanation
    at org.getopt.luke.plugins.CustomSimilarity.idfExplain(Unknown Source)
    at org.apache.lucene.search.TermQuery$TermWeight.<init>(TermQuery.java:46)
    at org.apache.lucene.search.TermQuery.createWeight(TermQuery.java:171)
    at org.apache.lucene.search.Query.weight(Query.java:101)
    at org.apache.lucene.search.Searcher.createWeight(Searcher.java:147)
    at org.apache.lucene.search.Searcher.search(Searcher.java:67)
    at org.getopt.luke.Luke$22.execute(Unknown Source)
    at org.getopt.luke.Luke._search(Unknown Source)
    at org.getopt.luke.Luke.search(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at thinlet.Thinlet.invokeImpl(Unknown Source)
    at thinlet.Thinlet.invoke(Unknown Source)
    at thinlet.Thinlet.handleMouseEvent(Unknown Source)
    at thinlet.Thinlet.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Component.java:4714)
    at java.awt.Container.dispatchEventImpl(Container.java:2143)
    at java.awt.Component.dispatchEvent(Component.java:4544)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
    at java.awt.Container.dispatchEventImpl(Container.java:2129)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4544)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Original issue reported on code.google.com by baltakal...@gmail.com on 25 Mar 2010 at 4:08

GoogleCodeExporter commented 9 years ago
Thanks for the report - indeed, Similarity API has changed in 3.0. I'll fix 
this shortly.

Original comment by sig...@gmail.com on 25 Mar 2010 at 4:17

GoogleCodeExporter commented 9 years ago
Thanks,
I will use this version to explain some things about Lucene in the IR lab. I am 
playing with it now, so I will report 
more issues if I will find.

Original comment by baltakal...@gmail.com on 25 Mar 2010 at 5:26

GoogleCodeExporter commented 9 years ago
This has been fixed in rev. 29 - thanks!

Original comment by sig...@gmail.com on 31 Mar 2010 at 4:29