@Override protected Analyzer getWrappedAnalyzer(String fieldName) { int dotIndex = fieldName.indexOf('.'); if (dotIndex != -1) { String possibleType = fieldName.substring(0, dotIndex); DocumentMapper possibleDocMapper = mappers.get(possibleType); if (possibleDocMapper != null) { return possibleDocMapper.mappers().searchQuoteAnalyzer(); } } FieldMappers mappers = fieldMappers.fullName(fieldName); if (mappers != null && mappers.mapper() != null && mappers.mapper().searchQuoteAnalyzer() != null) { return mappers.mapper().searchQuoteAnalyzer(); } mappers = fieldMappers.indexName(fieldName); if (mappers != null && mappers.mapper() != null && mappers.mapper().searchQuoteAnalyzer() != null) { return mappers.mapper().searchQuoteAnalyzer(); } return defaultAnalyzer; }
public FieldMapper smartNameFieldMapper(String smartName, @Nullable String[] types) { FieldMappers fieldMappers = smartNameFieldMappers(smartName, types); if (fieldMappers != null) { return fieldMappers.mapper(); } return null; }
/** * Same as {@link #smartNameFieldMappers(String)} but returns the first field mapper for it. * Returns <tt>null</tt> if there is none. */ public FieldMapper smartNameFieldMapper(String smartName) { FieldMappers fieldMappers = smartNameFieldMappers(smartName); if (fieldMappers != null) { return fieldMappers.mapper(); } return null; }
/** The first mapper for the smart named field. */ public FieldMapper mapper() { return fieldMappers.mapper(); }