/** * Returns an analyzer that wraps the given base analyzer with the analyzers of this individual field configuration.<p> * * @param analyzer the base analyzer to wrap * * @return an analyzer that wraps the given base analyzer with the analyzers of this individual field configuration */ public Analyzer getAnalyzer(Analyzer analyzer) { // parent folder and last modified lookup fields must use whitespace analyzer WhitespaceAnalyzer ws = new WhitespaceAnalyzer(); Map<String, Analyzer> analyzers = new HashMap<String, Analyzer>(); // first make map the default hard coded fields analyzers.put(CmsSearchField.FIELD_PARENT_FOLDERS, ws); analyzers.put(CmsSearchField.FIELD_CATEGORY, ws); analyzers.put(CmsSearchField.FIELD_DATE_LASTMODIFIED_LOOKUP, ws); analyzers.put(CmsSearchField.FIELD_DATE_CREATED_LOOKUP, ws); for (CmsLuceneField field : getLuceneFields()) { Analyzer fieldAnalyzer = field.getAnalyzer(); if (fieldAnalyzer != null) { // this field has an individual analyzer configured analyzers.put(field.getName(), fieldAnalyzer); } } // return the individual field configured analyzer return new PerFieldAnalyzerWrapper(analyzer, analyzers); }
field.getDefaultValue()); if (field.getAnalyzer() != null) { String className = field.getAnalyzer().getClass().getName(); if (className.startsWith(CmsSearchManager.LUCENE_ANALYZER)) { className = className.substring(CmsSearchManager.LUCENE_ANALYZER.length());
fieldElement.addAttribute(A_TYPE, field.getType()); if (field.getAnalyzer() != null) { String className = field.getAnalyzer().getClass().getName(); if (className.startsWith(CmsSearchManager.LUCENE_ANALYZER)) { className = className.substring(CmsSearchManager.LUCENE_ANALYZER.length());