Fonts Lucene和突出显示的文本字体问题

Fonts Lucene和突出显示的文本字体问题,fonts,lucene,lucene-highlighter,Fonts,Lucene,Lucene Highlighter,我使用Lucene HighLighter,取得了成功。这是我的密码: StringBuffer sb = new StringBuffer(); for (int t = 0; t < fields.length; t++) { SimpleHTMLFormatter formatter = new SimpleHTMLFormatter( "<span clas

我使用Lucene HighLighter,取得了成功。这是我的密码:

                    StringBuffer sb = new StringBuffer();
        for (int t = 0; t < fields.length; t++) {
            SimpleHTMLFormatter formatter = new SimpleHTMLFormatter(
                    "<span class=\"highlight\">", "</span>");
            Highlighter highlighter = new Highlighter(formatter,
                    new QueryScorer(parser.parse(queryString)));

            if (d.get(fields[t]) != null) {
                hilites = highlighter.getBestFragments(analyzer, fields[t],
                        d.get(fields[t]), 3);
                int l = hilites.length;
                // System.out.println("hilites length: "+l);
                if (l > 0) {

                    for (int x = 0; x < l; x++) {
                        sb.append(hilites[x]).append("...");
                    }

                }
            }

        }
注意这段时髦的文字


任何帮助都将不胜感激。

乱码文本问题可能与Lucene无关,而是与XML编码有关。您是否将“contentType”设置为“text/html;charset=UTF-8”?

谢谢您的建议。我的页面设置为utf-8。我甚至试过SimpleHTMLEncoder.htmlEncode(…)。无益!
**on Educational Materials ~ ATS Job Board ""OR~C'C" .. III DUES United States Full... ? SL[I!," Full Memberhsip - Domestic membership is for residents residing in the United States. Dues...**