You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Karl von Randow <ka...@cactuslab.com> on 2002/08/15 22:07:35 UTC

Serialization of org.apache.lucene.search.BooleanClause

Hi all,

The org.apache.lucene.search.BooleanClause is not currently Serializable, I
would like to propose that it is made serializable.

The problem arises when a BooleanQuery (Serializable) is included in a
query, as it contains BooleanClauses. As the Query class hierarchy is
Serializable I believe that BooleanClauses should also be Serializable.

I have made this modification and it is working as intended for me.

I'm not sure about the Filter hierarchy, should these be Serializable as
well? Maybe DateFilter should be Serializable - as it looks like it could
be - and then leave it up to the implementer of other Filters to make
Serializable or not.

Kind regards,
k@rl


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Serialization of org.apache.lucene.search.BooleanClause

Posted by Doug Cutting <cu...@lucene.com>.
Karl von Randow wrote:
> The org.apache.lucene.search.BooleanClause is not currently Serializable, I
> would like to propose that it is made serializable.

You're right, it should be.  This is a bug.  When I recently added 
support for remote searching I tested only TermQuery.

I fixed this and added unit test cases for BooleanQuery and PhraseQuery.

Thanks for catching this.

> I'm not sure about the Filter hierarchy, should these be Serializable as
> well?

Filter is already serializeable.  Note that subclasses should be 
careful, if they cache BitSets, to make sure that these are not 
serialized, by making the cache a transient field.  The recently added 
QueryFilter class does this.

Doug



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>