/** * Controls if this field value will be stored compressed or not.<p> * * If this is set to <code>true</code>, the value for {@link #isStored()} will also * be set to <code>true</code>, since compressed fields are always stored.<p> * * @param compressed if <code>true</code>, the field value will be stored compressed */ public void setCompressed(boolean compressed) { m_compressed = compressed; if (compressed) { setStored(true); } }
/** * Controls if the content of this field is stored in the Lucene index from a String parameter.<p> * * @param stored if <code>"true"</code>, then the field content is stored * * @see #setStored(boolean) */ public void setStored(String stored) { boolean isStored = false; boolean isCompressed = false; if (stored != null) { stored = stored.trim().toLowerCase(); if (STR_COMPRESS.equals(stored)) { isCompressed = true; isStored = true; } else if (STR_YES.equals(stored)) { // "yes", value will be stored but not compressed isStored = true; } else { // only "true" or "false" remain isStored = Boolean.valueOf(stored).booleanValue(); } } setStored(isStored); setCompressed(isCompressed); }
setStored(isStored); setCompressed(isCompressed); setIndexed(isIndexed);
m_field.setStored(true); m_field.setIndexed(true); m_field.setDisplayed(true);