lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Re: Serialization of Lucene Document objects
Date Tue, 22 Feb 2011 14:04:41 GMT
On Tue, Feb 22, 2011 at 2:58 PM, Erik Fäßler <> wrote:
>  Hi there,
> I'd like to serialize some Lucene Documents I've built before. My goal is to
> send the documents over a http connection to a Solr server which then should
> add them to its index.

ok so why do you build lucene documents if you use solr? Can you use
SolrJ which does all the serialization work for you?!
> I thought this would work as the Document class implements Serializable as
> do the Fields. Unfortunately, the serialization fails because the
> TokenStream class is not serializable. But if you create Fields on
> TokenStreams, these are stored in the Field objects and so the serialization
> does not seem possible.
> Did I miss something? Or is it just the case that you can serialize
> documents whose fields only have String values (I didn't check if this works
> indeed, but I guess so) and no documents which need a TokenStream?

Again solr should do all the tokenization work for you - no need to
use a TokenSTream on the client side.
> Other ideas how to archive my goal? I already have a solution where I let
> Solr build the document. This is too slow, however, I'd like to scale to
> document construction, so I'd rather want to do as much as work before as
> possible (my data is rather large and of a bit complicated structure).
so you mean you would want to do that analysis on the client side and
only shoot the already tokenized values to the server?
What exactly is too slow? Can you provide more info what the problem is?

After all I think you should ask on the solr-user list instead.

> Thanks for any hints!
> Regards,
>    Erik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message