/** * Returns a list of the concrete Lucene search fields.<p> * * @return a list of lucene search fields */ public List<CmsLuceneField> getLuceneFields() { List<CmsLuceneField> result = new ArrayList<CmsLuceneField>(); for (CmsSearchField field : getFields()) { if (field instanceof CmsLuceneField) { result.add((CmsLuceneField)field); } } return result; }
/** * 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 = getFields().iterator(); while (i.hasNext()) { CmsLuceneField field = (CmsLuceneField)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); }