You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Rishabh Joshi <ri...@gmail.com> on 2007/12/10 09:09:29 UTC

How to store a HashSet in the index?

Hi,

Can anyone help me on, as to how I can go about "efficiently" indexing
(actually, storing in the index) and retrieving, a HashSet object, which
contains multiple string arrays?
I just want to store the HashSet in the index, and not search on it. The
HashSet should be returned with the document when I perform a search on any
other fields.

Regards,
Rishabh

Re: How to store a HashSet in the index?

Posted by Rishabh Joshi <ri...@gmail.com>.
Mike,

By "efficient" here I meant the 'easiest way to implement' the storage of
the HashSet in the index.

Rishabh

On Dec 11, 2007 12:57 AM, Mike Klaas <mi...@gmail.com> wrote:

> On 10-Dec-07, at 12:09 AM, Rishabh Joshi wrote:
>
> > Can anyone help me on, as to how I can go about "efficiently" indexing
> > (actually, storing in the index) and retrieving, a HashSet object,
> > which
> > contains multiple string arrays?
> > I just want to store the HashSet in the index, and not search on
> > it. The
> > HashSet should be returned with the document when I perform a
> > search on any
> > other fields.
>
> I don't know what "efficient" means in your context, but why not
> serialize to bytes and base64 encode, then store as you would a text
> field in Solr?
>
> -Mike
>

Re: How to store a HashSet in the index?

Posted by Mike Klaas <mi...@gmail.com>.
On 10-Dec-07, at 12:09 AM, Rishabh Joshi wrote:

> Can anyone help me on, as to how I can go about "efficiently" indexing
> (actually, storing in the index) and retrieving, a HashSet object,  
> which
> contains multiple string arrays?
> I just want to store the HashSet in the index, and not search on  
> it. The
> HashSet should be returned with the document when I perform a  
> search on any
> other fields.

I don't know what "efficient" means in your context, but why not  
serialize to bytes and base64 encode, then store as you would a text  
field in Solr?

-Mike

Re: How to store a HashSet in the index?

Posted by Rishabh Joshi <ri...@gmail.com>.
Thanks Eric!

Rishabh

On Dec 10, 2007 3:30 PM, Erik Hatcher <er...@ehatchersolutions.com> wrote:

> On Dec 10, 2007, at 3:10 AM, Rishabh Joshi wrote:
> > Can anyone help me on, as to how I can go about "efficiently" indexing
> > (actually, storing in the index) and retrieving, a HashSet object,
> > which
> > contains multiple string arrays?
> > I just want to store the HashSet in the index, and not search on
> > it. The
> > HashSet should be returned with the document when I perform a
> > search on any
> > other fields.
>
> If you have Java on indexing and querying side of things, you could
> simply serialize and stringify (via uuencoding perhaps) the HashSet,
> and deserialize it on retrieval.  Just be sure to set the field to be
> untokenized and stored.
>
>        Erik
>
>

Re: How to store a HashSet in the index?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 10, 2007, at 3:10 AM, Rishabh Joshi wrote:
> Can anyone help me on, as to how I can go about "efficiently" indexing
> (actually, storing in the index) and retrieving, a HashSet object,  
> which
> contains multiple string arrays?
> I just want to store the HashSet in the index, and not search on  
> it. The
> HashSet should be returned with the document when I perform a  
> search on any
> other fields.

If you have Java on indexing and querying side of things, you could  
simply serialize and stringify (via uuencoding perhaps) the HashSet,  
and deserialize it on retrieval.  Just be sure to set the field to be  
untokenized and stored.

	Erik


How to store a HashSet in the index?

Posted by Rishabh Joshi <ri...@gmail.com>.
Hi,

Can anyone help me on, as to how I can go about "efficiently" indexing
(actually, storing in the index) and retrieving, a HashSet object, which
contains multiple string arrays?
I just want to store the HashSet in the index, and not search on it. The
HashSet should be returned with the document when I perform a search on any
other fields.

Regards,
Rishabh