example class
{code} class MyDocument { @DocumentId long id;
@Fields java.util.Map<String, String> metaData; } {code}
the {{ @Fields }} annotation stores each key value pair as a Lucene key value.
this allows efficient searching on loosely typed object meta data (which is typically hard to map onto a relational database model but perfect for a Lucene index)
note : this could probably be realized with a {{FieldBridge}} but a specific annotation could be handy
note : ideally a {{MultiMap}} is also supported as a property can have multiple occurrences in a Lucene document
|