From 471c1149e77727de431023507214f12ea548863f Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 25 Dec 2012 02:00:33 +0000 Subject: [PATCH] use the constant in unicodeutil already defined for this purpose git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1425699 13f79535-47bb-0310-9956-ffa450edef68 --- .../sandbox/postingshighlight/PostingsHighlighter.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/postingshighlight/PostingsHighlighter.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/postingshighlight/PostingsHighlighter.java index 91626b31565..bae07941922 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/postingshighlight/PostingsHighlighter.java +++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/postingshighlight/PostingsHighlighter.java @@ -51,6 +51,7 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.TopDocs; import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.UnicodeUtil; /** * Simple highlighter that does not analyze fields nor use @@ -88,9 +89,7 @@ public final class PostingsHighlighter { /** Default maximum content size to process. Typically snippets * closer to the beginning of the document better summarize its content */ public static final int DEFAULT_MAX_LENGTH = 10000; - - // this looks bogus, but its not. we are dealing with characters :) - private static final BytesRef ceilingBytes = new BytesRef(new byte[] { (byte)0xff }); + private final String field; private final Term floor; private final Term ceiling; @@ -119,7 +118,7 @@ public final class PostingsHighlighter { this.scorer = scorer; this.formatter = formatter; floor = new Term(field, ""); - ceiling = new Term(field, ceilingBytes); + ceiling = new Term(field, UnicodeUtil.BIG_TERM); } /**