/** * Public constructor for a new search field mapping.<p> * * @param type the type to use, see {@link #setType(CmsSearchFieldMappingType)} * @param param the mapping parameter, see {@link #setParam(String)} */ public CmsSearchFieldMapping(CmsSearchFieldMappingType type, String param) { this(); setType(type); setParam(param); }
/** * * @see org.opencms.search.fields.CmsSearchFieldConfiguration#addField(org.opencms.search.fields.CmsSearchField) */ @Override public void addField(CmsSearchField field) { super.addField(field); m_fieldAdded = true; }
/** * Returns the display name of the field.<p> * * @return the display name of the field */ public String getDisplayName() { if (!isDisplayed()) { return IGNORE_DISPLAY_NAME; } if (m_displayName == null) { return getName(); } else { return m_displayName; } }
/** * Adds fields.<p> * * @param fields the fields to add */ public void addFields(Collection<CmsSearchField> fields) { for (CmsSearchField field : fields) { if (!getFieldNames().contains(field.getName())) { addField(field); } } }
/** * Returns <code>true</code> if this fields content is used in the search result excerpt.<p> * * A field can only be used in the excerpt if it is stored, see {@link #isStored()}.<p> * * @return <code>true</code> if this fields content is used in the search result excerpt * * @see #isStored() */ public boolean isInExcerptAndStored() { return isInExcerpt() && isStored(); }
/** * @see java.lang.Object#toString() */ @Override public String toString() { return getName(); } }
/** * Sets the indexed value of the field.<p> * * @param indexed String value of the indexed value */ public void setIndexed(String indexed) { m_field.setIndexed(indexed); }
/** * Sets the boost factor of this field (only for display use).<p> * * @param boost the boost factor to set * * @see #setBoost(String) */ public void setBoostDisplay(String boost) { setBoost(boost); }
/** * Sets the boost factor of this field (only for display use).<p> * * @param boost the boost factor to set * * @see #setBoost(String) */ public void setBoostDisplay(String boost) { setBoost(boost); }
/** * Sets the mapping type of the mapping.<p> * * @param type String value of the mapping type */ public void setType(String type) { m_mapping.setType(type); }
/** * 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); } }
/** * Returns the String value of the indexed value.<p> * * @return String value of the indexed value */ public String getIndexed() { if ((m_field != null) && (m_field.getIndexed() != null)) { return m_field.getIndexed(); } return ""; }
/** * Sets the displayNameForConfiguration.<p> * * @param displayNameForConfiguration the displayNameForConfiguration to set */ public void setDisplayNameForConfiguration(String displayNameForConfiguration) { m_displayNameForConfiguration = displayNameForConfiguration; setDisplayName(displayNameForConfiguration); }
/** * Sets the displayNameForConfiguration.<p> * * @param displayNameForConfiguration the displayNameForConfiguration to set */ public void setDisplayNameForConfiguration(String displayNameForConfiguration) { m_displayNameForConfiguration = displayNameForConfiguration; setDisplayName(displayNameForConfiguration); }
/** * 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); } }
/** * Returns the display name of the field.<p> * * @return the display name of the field */ public String getDisplayName() { if (!isDisplayed()) { return IGNORE_DISPLAY_NAME; } if (m_displayName == null) { return m_name; } else { return m_displayName; } }
/** * Public constructor for a new search field mapping.<p> * * @param type the type to use, see {@link #setType(CmsSearchFieldMappingType)} * @param param the mapping parameter, see {@link #setParam(String)} */ public CmsSearchFieldMapping(CmsSearchFieldMappingType type, String param) { this(); setType(type); setParam(param); }
/** * Sets the indexed value of the field.<p> * * @param indexed String value of the indexed value */ public void setIndexed(String indexed) { m_field.setIndexed(indexed); }
/** * Returns the String value of the indexed value.<p> * * @return String value of the indexed value */ public String getIndexed() { if ((m_field != null) && (m_field.getIndexed() != null)) { return m_field.getIndexed(); } return ""; }