Mailing List Archive

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: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Serialization of org.apache.lucene.search.BooleanClause [ In reply to ]
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: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>