lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Westfall" <>
Subject RE: Searching for similar documents
Date Wed, 20 Jul 2005 17:47:35 GMT
I hope you will forgive the newbie question but do I have to add the
MoreLikeThis.class file to the Lucene-1.4.3.JAR for it to work?

I put the .class file in my \wwwroot\web-inf\classes folder and I am
getting an error I don't understand when trying to instantiate the
object from Cold Fusion. I also added the .class to a .jar and put it in
\lib to no avail. I don't know if this is a CF problem or a Java

CF Error: Object Instantiation Exception.  
An exception occurred when instantiating a java object. The cause of
this exception was that: MoreLikeThis (wrong name:

	// get an IndexReader object to use in the constructor to the
searcher var
	indexReader = CreateObject("java",
	// get an IndexSearcher object
	searcher = CreateObject("java",
	searcher = searcher.init(;

	// get an Analyzer object	  
	analyzer = CreateObject("java",
	mlt = CreateObject("java", "MoreLikeThis"); // <---- this is the
line that causes the error
	// [ I have also tried 	mlt = CreateObject("java",

 	target = "test of the similarity feature";
 	query = target);
	hits = CreateObject("java", "");
	hits =;

-----Original Message-----
From: Erik Hatcher [] 
Sent: Tuesday, July 19, 2005 10:59 AM
Subject: Re: Searching for similar documents

On Jul 19, 2005, at 12:42 PM, Kadlabalu, Hareesh wrote:
> If someone could someone please extract a version of this file from 
> source control that corresponds to lucene 1.4.3 or if this can file 
> can be back-ported, it would be greatly helpful.

The old Jakarta Lucene Sandbox is still available via CVS:

     cvs co jakarta-

> 1.
> IndexReader.getFieldNames( IndexReader.FieldOption.INDEXED ) does not 
> compile on 1.4.3, replace with IndexReader.getIndexedFieldNames ( true

> )?

I think you want false, not true.  The boolean flag refers to term
vector data.

> 2.
> query.add(tq, BooleanClause.Occur.SHOULD) does not compile on 1.4.3, 
> is this the same as query.add( tq, true, true )?

No.  It's the same as add(tq, false, false)

> I have one small request, is it possible to make the archive of 
> 'Contribution' section that corresponds to Lucene
> 1.4.3 release available online?

At this point we're probably too far removed from it to accomplish that
cleanly.  MoreLikeThis may not have ever been 1.4.3 compatible - I don't
recall - it certainly wasn't added until well after 1.4.3 was released.
The CVS repository should be sufficient for folks to build it themselves
if necessary.

For most of the old Sandbox contributions, you can find binary releases
of those in the Lucene in Action code distribution at


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message