when using keyword based analayzer on _all, an NPE is thrown since there is no current entry, ignore it (it does not make sense to have keywork analyzer on _all field...)

This commit is contained in:
kimchy 2010-09-28 14:53:37 +02:00
parent 55ae6b2001
commit d3978383a5
1 changed files with 7 additions and 5 deletions

View File

@ -56,11 +56,13 @@ public class AllTokenStream extends TokenFilter {
if (!input.incrementToken()) { if (!input.incrementToken()) {
return false; return false;
} }
float boost = allEntries.current().boost(); if (allEntries.current() != null) {
if (boost != 1.0f) { float boost = allEntries.current().boost();
payloadAttribute.setPayload(new Payload(encodeFloat(boost))); if (boost != 1.0f) {
} else { payloadAttribute.setPayload(new Payload(encodeFloat(boost)));
payloadAttribute.setPayload(null); } else {
payloadAttribute.setPayload(null);
}
} }
return true; return true;
} }