You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Densel Santhmayor <de...@gmail.com> on 2009/03/17 17:52:37 UTC

Error using DuplicateFilter in contrib/queries

Hello

I was trying to use the DuplicateFilter api in contrib/queries for Lucene in
an
application but it doesn't seem to be accepted as a valid argument to the
searcher.search function. I'm using Apache Lucene 2.4.0.

Here's what I did.

DuplicateFilter df=new DuplicateFilter("NAME");
df.setKeepMode(DuplicateFilter.KM_USE_FIRST_OCCURRENCE);
return indexSearcher.search(query, df);

Pretty simple implementation, right? But I keep getting this error:

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.VerifyError: (class: search/SearchManager, method:
performSearch signature:
([Ljava/lang/String;II)Lorg/apache/lucene/search/TopDocs;) Incompatible
argument to function

performSearch is my api where I call the above code. If I change the line to

return indexSearcher.search(query, (Filter)null);

then this error doesn't come up anymore.

Could this be a class version issue? ie. the DuplicateFilter class may be in
a
Jar from a Lucene 2.3 version where the Filter base class was defined with
different methods?

Does anyone know of a DuplicateFilter class for version 2.4? Has the Filter
base class
been defined with different methods and that's why this doesn't work? Where
can I get
the latest version of DuplicateFilter?

Thanks for your time and replies
DM