001    package railo.runtime.search.lucene2.highlight;
002    
003    import org.apache.lucene.analysis.Analyzer;
004    import org.apache.lucene.search.Query;
005    
006    
007    public class Highlight {
008    
009            public static String createContextSummary(Object highlighter, Analyzer analyzer, String text,int maxNumFragments, int maxLength,String defaultValue) {
010                    if(maxNumFragments==0) return "";
011                    try {
012                            return _Highlight.createContextSummary(highlighter, analyzer, text,maxNumFragments, defaultValue);
013                    }
014                    catch (Throwable t) {t.printStackTrace();}      
015                    return defaultValue;
016            }
017    
018            public static Object createHighlighter(Query query,String highlightBegin,String highlightEnd) {
019                    try {
020                            return _Highlight.createHighlighter(query,highlightBegin,highlightEnd);
021                    }
022                    catch (Throwable t) {t.printStackTrace();}
023                    return null;
024            }
025    
026    }