LUCENE-2064: Highlighter support all MultiTermQuery subclasses without explicit casts - previous commit did not contain final patch due to JIRA AM / PM issue

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@836176 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2009-11-14 13:44:53 +00:00
parent c2cc1eaee7
commit 5e5e5aa85a
1 changed files with 6 additions and 23 deletions

View File

@ -567,31 +567,14 @@ public class WeightedSpanTermExtractor {
}
@Override
public TermEnum terms(Term t) throws IOException {
field = t.field();
return new TermEnum() {
@Override
public Term term() {
return null;
}
@Override
public boolean next() throws IOException {
return false;
}
@Override
public int docFreq() {
return 0;
}
@Override
public void close() throws IOException {
}
};
public TermEnum terms(final Term t) throws IOException {
// only set first fieldname, maybe use a Set?
if (t != null && field == null)
field = t.field();
return super.terms(t);
}
}
}