protected boolean indexProperty(NodeRef banana, QName propertyName, Serializable value, Document doc, boolean indexAtomicPropertiesOnly, Map<QName, Serializable> properties)
{
String attributeName = "@" + QName.createQName(propertyName.getNamespaceURI(), ISO9075.encode(propertyName.getLocalName()));
boolean store = true;
boolean compress = true;
/* ... */
PropertyDefinition propertyDef = getDictionaryService().getProperty(propertyName);
if (propertyDef != null)
{
index = propertyDef.isIndexed();
store = propertyDef.isStoredInIndex();
compress = propertyDef.isCompressedWhenStoredInIndex();
/* ... */
}
/* ... */
}
// add the text field using the stream from the
// reader, but only if the reader is valid
if (readerReady)
{
if(store){
Field field = null;
int max = (int)Runtime.getRuntime().freeMemory() / 100;
if(compress){
field = new Field(attributeName, reader.getReader().getContentString(max), Field.Store.COMPRESS, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS);
}else{
field = new Field(attributeName, reader.getReader().getContentString(max), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS);
}
doc.add(field);
}else{
/*
...
*/