dsmiley commented on a change in pull request #712:
URL: https://github.com/apache/solr/pull/712#discussion_r815263861
##########
File path: solr/core/src/java/org/apache/solr/schema/FieldType.java
##########
@@ -502,24 +502,51 @@ public Query getPrefixQuery(QParser parser, SchemaField
sf, String termStr) {
@Override
public TokenStreamComponents createComponents(String fieldName) {
Tokenizer ts = new Tokenizer() {
+ private boolean done = false;
+ private int finalOffset;
+
final char[] cbuf = new char[maxChars];
final CharTermAttribute termAtt =
addAttribute(CharTermAttribute.class);
final BytesTermAttribute bytesAtt = isPointField() ?
addAttribute(BytesTermAttribute.class) : null;
final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
+
@Override
public boolean incrementToken() throws IOException {
- clearAttributes();
- int n = input.read(cbuf,0,maxChars);
- if (n<=0) return false;
- if (isPointField()) {
- BytesRef b = ((PointField)FieldType.this).toInternalByteRef(new
String(cbuf, 0, n));
- bytesAtt.setBytesRef(b);
- } else {
- String s = toInternal(new String(cbuf, 0, n));
- termAtt.setEmpty().append(s);
+ if (!done) {
Review comment:
does `done` ever get set to true? I don't see it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]