lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <>
Subject Dealing with field values as key/value pairs
Date Mon, 01 Dec 2008 16:37:58 GMT
Hi all,

I'm looking for ideas about how to best deal with a situation where I 
need to deal with storing key/values pairs in the index for consumption 
in the client.

Typical example would be to have a document with multiple genres where 
for simplicity reasons i'd like to send both the 'id' and the 'human 
readable label' (might not be the best example since one would 
immediatly say 'what about localization', but in that case assume it's 
an entity such as company name or a person name).

So say I have

field1 = { 'key1':'this is value1', 'key2':'this is value2' }

I was thinking the easiest (not the prettiest) solution would be to 
store it as effectively a string 'key:this is the value' and then have 
the client deal with this 'format' and then parse it based on 
'<key>:<value>' pattern

Another alternative I was thinking may have been to use a custom field 
that effectively would make the field value as a map key/value for the 
writer but I'm not so sure it can really be done, haven't investigated 
that one deeply.

Any feedback would be welcome, solution might even be simpler and 
cleaner than what I'm mentioning above, but my brain is mushy in the 
last couple of weeks.

-- stephane

View raw message