lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Storing HashMap as an UnIndexed Field
Date Tue, 20 Sep 2005 19:37:54 GMT

On Sep 20, 2005, at 3:29 PM, Tricia Williams wrote:
> Do you think there is anyway that I could use the serialization  
> already
> built into the HashMap data structure?

A Document, when reconstituted from Hits, is essentially a glorified  
HashMap-like structure.  I recommend you simply iterate your HashMap  
during indexing and add each entry to the Document as a Field.Keyword  
or as an unindexed field.  It may be slightly more code than doing  
some type of serialization/de-serialization, but not by much.

     Erik


>
> On Tue, 20 Sep 2005, Mordo, Aviran (EXP N-NANNATEK) wrote:
>
>
>> You can store the values as a coma separated string (which then  
>> you'll
>> need to parse manually back to a HashMap)
>>
>> -----Original Message-----
>> From: Tricia Williams [mailto:pgwillia@student.cs.uwaterloo.ca]
>> Sent: Tuesday, September 20, 2005 3:14 PM
>> To: java-user@lucene.apache.org
>> Subject: Storing HashMap as an UnIndexed Field
>>
>> Hi,
>>
>>    I'd like to store a HashMap for some extra data to be used when a
>> given document is retrieved as a Hit for a query.  To add an  
>> UnIndexed
>> Field to an index takes only Strings as parameters.  Does anyone have
>> any suggestions on how I might convert the HashMap to a String  
>> that is
>> efficiently recomposed into the desired HashMap on the other end?
>>
>> Thanks,
>> Tricia
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message