Codota Logo
CmsSearchField.getName
Code IndexAdd Codota to your IDE (free)

How to use
getName
method
in
org.opencms.search.fields.CmsSearchField

Best Java code snippets using org.opencms.search.fields.CmsSearchField.getName (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: org.opencms/opencms-core

  /**
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {

    return getName();
  }
}
origin: org.opencms/opencms-core

/**
 * Returns the list of configured field names (Strings).<p>
 *
 * @return the list of configured field names (Strings)
 */
public List<String> getFieldNames() {
  if (m_fieldNames == null) {
    // lazy initialize the field names
    m_fieldNames = new ArrayList<String>();
    for (CmsSearchField field : m_fields) {
      m_fieldNames.add(field.getName());
    }
  }
  // create a copy of the list to prevent changes in other classes
  return new ArrayList<String>(m_fieldNames);
}
origin: org.opencms/opencms-core

/**
 * Returns the configured {@link CmsSearchField} instance with the given name.<p>
 *
 * @param name the search field name to look up
 *
 * @return the configured {@link CmsSearchField} instance with the given name
 */
public CmsSearchField getField(String name) {
  if (m_fieldLookup == null) {
    // lazy initialize the field names
    m_fieldLookup = new HashMap<String, CmsSearchField>();
    for (CmsSearchField field : m_fields) {
      m_fieldLookup.put(field.getName(), field);
    }
  }
  return m_fieldLookup.get(name);
}
origin: org.opencms/opencms-core

/**
 * Two fields are equal if the name of the Lucene field is equal.<p>
 *
 * @see java.lang.Object#equals(java.lang.Object)
 */
@Override
public boolean equals(Object obj) {
  if ((obj instanceof CmsSearchField)) {
    return CmsStringUtil.isEqual(m_name, ((CmsSearchField)obj).getName());
  }
  return false;
}
origin: org.opencms/opencms-solr

/**
 * Returns the list of configured field names (Strings).<p>
 *
 * @return the list of configured field names (Strings)
 */
public List<String> getFieldNames() {
  if (m_fieldNames == null) {
    // lazy initialize the field names
    m_fieldNames = new ArrayList<String>();
    Iterator<CmsSearchField> i = m_fields.iterator();
    while (i.hasNext()) {
      m_fieldNames.add((i.next()).getName());
    }
  }
  // create a copy of the list to prevent changes in other classes
  return new ArrayList<String>(m_fieldNames);
}
origin: org.opencms/opencms-solr

/**
 * Returns the configured {@link CmsSearchField} instance with the given name.<p>
 *
 * @param name the search field name to look up
 *
 * @return the configured {@link CmsSearchField} instance with the given name
 */
public CmsSearchField getField(String name) {
  if (m_fieldLookup == null) {
    // lazy initialize the field names
    m_fieldLookup = new HashMap<String, CmsSearchField>();
    Iterator<CmsSearchField> i = m_fields.iterator();
    while (i.hasNext()) {
      CmsSearchField field = i.next();
      m_fieldLookup.put(field.getName(), field);
    }
  }
  return m_fieldLookup.get(name);
}
origin: org.opencms/opencms-core

  /**
   * Returns the field names used for a regular result.<p>
   *
   * @return the field names used for a regular result
   */
  public Set<String> getReturnFields() {

    if (m_fieldAdded) {
      for (CmsSearchField field : getLuceneFields()) {
        if (field.isStored() && !LAZY_FIELDS.contains(field.getName())) {
          m_returnFields.add(field.getName());
        }
      }
    }
    m_fieldAdded = false;
    return m_returnFields;
  }
}
origin: org.opencms/opencms-solr

/**
 * Returns a list of all field names (Strings) that are used in generating the search excerpt.<p>
 *
 * @return a list of all field names (Strings) that are used in generating the search excerpt
 */
public List<String> getExcerptFieldNames() {
  if (m_excerptFieldNames == null) {
    // lazy initialize the field names
    m_excerptFieldNames = new ArrayList<String>();
    Iterator<CmsSearchField> i = m_fields.iterator();
    while (i.hasNext()) {
      CmsSearchField field = i.next();
      if (field.isInExcerptAndStored()) {
        m_excerptFieldNames.add(field.getName());
      }
    }
  }
  // create a copy of the list to prevent changes in other classes
  return new ArrayList<String>(m_excerptFieldNames);
}
origin: org.opencms/opencms-core

/**
 * 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);
    }
  }
}
origin: org.opencms/opencms-core

/**
 * Adds a Solr field for an element.<p>
 *
 * @param contentDefinition the XML content definition this XML content handler belongs to
 * @param field the Solr field
 * @param type the type, specifying if the field should be attached to the document of the XML content or to all container pages the content is placed on
 */
protected void addSearchField(
  CmsXmlContentDefinition contentDefinition,
  CmsSearchField field,
  I_CmsXmlContentHandler.MappingType type) {
  Locale locale = null;
  if (field instanceof CmsSolrField) {
    locale = ((CmsSolrField)field).getLocale();
  }
  String key = CmsXmlUtils.concatXpath(locale != null ? locale.toString() : null, field.getName());
  switch (type) {
    case PAGE:
      m_searchFieldsPage.put(key, field);
      break;
    case ELEMENT:
    default:
      m_searchFields.put(key, field);
      break;
  }
}
origin: org.opencms/opencms-solr

/**
 * Returns a list of <code>{@link CmsSelectWidgetOption}</code> objects for field list selection.<p>
 * 
 * @return a list of <code>{@link CmsSelectWidgetOption}</code> objects
 */
private List getFieldList() {
  List retVal = new ArrayList();
  try {
    Iterator i = getFields().iterator();
    while (i.hasNext()) {
      CmsSearchField field = (CmsSearchField)i.next();
      retVal.add(new CmsSelectWidgetOption(field.getName(), true, getMacroResolver().resolveMacros(
        field.getDisplayName())));
    }
  } catch (Exception e) {
    // noop
  }
  return retVal;
}
origin: org.opencms/opencms-solr

result.addAnalyzer(field.getName(), fieldAnalyzer);
origin: org.opencms/opencms-solr

/**
 * Removes a search field mapping from the given field.<p>
 * 
 * @param field the field
 * @param mapping mapping to remove from the field
 * 
 * @return true if remove was successful, false if preconditions for removal are ok but the given 
 *         mapping was unknown.
 * 
 * @throws CmsIllegalStateException if the given mapping is the last mapping inside the given field.
 */
public boolean removeSearchFieldMapping(CmsSearchField field, CmsSearchFieldMapping mapping)
throws CmsIllegalStateException {
  if (field.getMappings().size() < 2) {
    throw new CmsIllegalStateException(Messages.get().container(
      Messages.ERR_FIELD_MAPPING_DELETE_2,
      mapping.getType().toString(),
      field.getName()));
  } else {
    if (LOG.isInfoEnabled()) {
      LOG.info(Messages.get().getBundle().key(
        Messages.LOG_REMOVE_FIELD_MAPPING_INDEX_2,
        mapping.toString(),
        field.getName()));
    }
    return field.getMappings().remove(mapping);
  }
}
origin: org.opencms/opencms-solr

/**
 * Removes a search field from the field configuration.<p>
 * 
 * @param fieldConfiguration the field configuration
 * @param field field to remove from the field configuration
 * 
 * @return true if remove was successful, false if preconditions for removal are ok but the given 
 *         field was unknown.
 * 
 * @throws CmsIllegalStateException if the given field is the last field inside the given field configuration.
 */
public boolean removeSearchFieldConfigurationField(
  CmsSearchFieldConfiguration fieldConfiguration,
  CmsSearchField field) throws CmsIllegalStateException {
  if (fieldConfiguration.getFields().size() < 2) {
    throw new CmsIllegalStateException(Messages.get().container(
      Messages.ERR_CONFIGURATION_FIELD_DELETE_2,
      field.getName(),
      fieldConfiguration.getName()));
  } else {
    if (LOG.isInfoEnabled()) {
      LOG.info(Messages.get().getBundle().key(
        Messages.LOG_REMOVE_FIELDCONFIGURATION_FIELD_INDEX_2,
        field.getName(),
        fieldConfiguration.getName()));
    }
    return fieldConfiguration.getFields().remove(field);
  }
}
origin: org.opencms/org.opencms.workplace.tools.searchindex

/**
 * @see org.opencms.workplace.CmsWidgetDialog#actionCommit()
 */
@Override
public void actionCommit() {
  List<Throwable> errors = new ArrayList<Throwable>();
  try {
    // if new create it first
    boolean found = false;
    for (CmsSearchField field : m_fieldconfiguration.getFields()) {
      if (field.getName().equals(m_field.getName())) {
        found = true;
      }
    }
    if (!found) {
      m_fieldconfiguration.addField(m_field);
    }
    if (checkWriteConfiguration()) {
      writeConfiguration();
    }
  } catch (Throwable t) {
    errors.add(t);
  }
  // set the list of errors to display when saving failed
  setCommitErrors(errors);
}
origin: org.opencms/opencms-core

    Messages.get().container(
      Messages.ERR_CONFIGURATION_FIELD_DELETE_2,
      field.getName(),
      fieldConfiguration.getName()));
} else {
      Messages.get().getBundle().key(
        Messages.LOG_REMOVE_FIELDCONFIGURATION_FIELD_INDEX_2,
        field.getName(),
        fieldConfiguration.getName()));
origin: org.opencms/opencms-core

if (mappedFields != null) {
  for (CmsSearchField field : mappedFields) {
    if (!systemFields.contains(field.getName())) {
      document = appendFieldMapping(
        document,
          Messages.LOG_SOLR_ERR_MAPPING_TO_INTERNALLY_USED_FIELD_2,
          resource.getRootPath(),
          field.getName()));
origin: org.opencms/org.opencms.workplace.tools.searchindex

while (itFields.hasNext()) {
  CmsSearchField curField = itFields.next();
  if (curField.getName().equals(getParamField())) {
    m_field = curField;
    break;
origin: org.opencms/opencms-core

if (!systemFields.contains(field.getName())) {
  document = appendFieldMapping(
    document,
      Messages.LOG_SOLR_ERR_MAPPING_TO_INTERNALLY_USED_FIELD_3,
      elemResource.getRootPath(),
      field.getName(),
      resource.getRootPath()));
origin: org.opencms/opencms-solr

  store = Field.Store.YES;
Field result = new Field(getName(), content, store, index);
if (getBoost() != BOOST_DEFAULT) {
  result.setBoost(getBoost());
org.opencms.search.fieldsCmsSearchFieldgetName

Javadoc

Returns the name of this field in the Lucene search index.

Popular methods of CmsSearchField

  • getMappings
    Returns the mappings for this field.
  • addMapping
    Adds a new field mapping to the internal list of mappings.
  • isStored
    Returns true if the content of this field is stored in the Lucene index. Please refer to the Lucene
  • setBoost
    Sets the boost factor for this field from a String value.
  • <init>
  • addUninvertingMappings
    To allow sorting on a field the field must be added to the map given to org.apache.lucene.uninvertin
  • createField
    Creates a Lucene field from the configuration and the provided content. If no valid content is provi
  • getAnalyzer
    Returns the analyzer used for this field.
  • getBoost
    Returns the boost factor of this field. The boost factor is a Lucene function that controls the "imp
  • getDefaultValue
    Returns the default value to use if no content for this field was collected. In case no default is c
  • getDisplayName
    Returns the display name of the field.
  • getDisplayNameForConfiguration
    Returns the displayNameForConfiguration.
  • getDisplayName,
  • getDisplayNameForConfiguration,
  • isCompressed,
  • isDisplayed,
  • isInExcerptAndStored,
  • isIndexed,
  • isTokenizedAndIndexed,
  • setAnalyzer,
  • setCompressed

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Menu (java.awt)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Collectors (java.util.stream)
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now