LUCENE-3590: fix solr breakage due to bytesref changes

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1206262 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2011-11-25 17:08:33 +00:00
parent 098371446a
commit 1de301e90a
1 changed files with 5 additions and 5 deletions

View File

@ -159,7 +159,7 @@
final BytesRef bytes = bytesAtt.getBytesRef();
while (tstream.incrementToken()) {
bytesAtt.fillBytesRef();
matches.add(new BytesRef(bytes));
matches.add(BytesRef.deepCopyOf(bytes));
}
}
@ -282,12 +282,12 @@
Tok(AttributeSource token, int pos, FieldType ft) {
this.pos = pos;
TermToBytesRefAttribute termAtt = token.getAttribute(TermToBytesRefAttribute.class);
BytesRef spare = termAtt.getBytesRef();
termAtt.fillBytesRef();
bytes = new BytesRef(spare);
BytesRef termBytes = termAtt.getBytesRef();
termAtt.fillBytesRef();
bytes = BytesRef.deepCopyOf(termBytes);
text = ft.indexedToReadable(bytes, new CharsRef()).toString();
rawText = (token.hasAttribute(CharTermAttribute.class)) ?
token.getAttribute(CharTermAttribute.class).toString() : null;
text = ft.indexedToReadable(bytes, new CharsRef()).toString();
token.reflectWith(new AttributeReflector() {
public void reflect(Class<? extends Attribute> attClass, String key, Object value) {
// leave out position and raw term