String fieldIndex = field.getIndexed(); boolean fieldExcerpt = field.isInExcerpt(); float fieldBoost = field.getBoost(); String fieldDefault = field.getDefaultValue();
String fieldIndex = field.getIndexed(); boolean fieldExcerpt = field.isInExcerpt(); float fieldBoost = field.getBoost(); String fieldDefault = field.getDefaultValue();
/** * @see org.opencms.workplace.list.A_CmsListDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() { List<CmsListItem> result = new ArrayList<CmsListItem>(); // get content List<CmsSearchField> fields = getFields(); Iterator<CmsSearchField> itFields = fields.iterator(); CmsLuceneField field; while (itFields.hasNext()) { field = (CmsLuceneField)itFields.next(); CmsListItem item = getList().newItem(field.getName()); String defaultValue = field.getDefaultValue(); if (defaultValue == null) { defaultValue = "-"; } item.set(LIST_COLUMN_NAME, field.getName()); item.set(LIST_COLUMN_DISPLAY, resolveMacros(field.getDisplayName())); item.set(LIST_COLUMN_BOOST, new Float(field.getBoost()).toString()); item.set(LIST_COLUMN_INDEX, field.getIndexed()); item.set(LIST_COLUMN_EXCERPT_HIDE, Boolean.valueOf(field.isInExcerpt())); item.set(LIST_COLUMN_STORE_HIDE, Boolean.valueOf(field.isStored())); item.set(LIST_COLUMN_DEFAULT, defaultValue); result.add(item); } return result; }
/** * Public constructor.<p> * * @param luceneField */ public CmsSolrField(CmsLuceneField luceneField) { super(); String name = luceneField.getName(); IndexSchema schema = OpenCms.getSearchManager().getSolrServerConfiguration().getSolrSchema(); if (schema.hasExplicitField(name)) { // take the lucene field name for Solr } else if ((luceneField.getType() != null) && schema.isDynamicField(luceneField.getName() + "_" + luceneField.getType())) { // try to use the specified type attribute as dynamic field suffix name = luceneField.getName() + "_" + luceneField.getType(); } else { // fallback create a general_text field name = luceneField.getName() + "_txt"; } setName(name); setBoost(luceneField.getBoost()); setDefaultValue(luceneField.getDefaultValue()); for (I_CmsSearchFieldMapping mapping : luceneField.getMappings()) { addMapping(mapping); } }