fixed bug

Former-commit-id: a9d2e22c806dc3bbd694f3d5f57d7aa11371fe44
This commit is contained in:
Jeremy Long
2013-03-08 17:32:16 -05:00
parent c7f7324d05
commit 7d67d3fa86

View File

@@ -59,7 +59,13 @@ public final class VersionTokenizingFilter extends TokenFilter {
public boolean incrementToken() throws IOException {
if (tokens.size() == 0 && input.incrementToken()) {
String version = new String(termAtt.buffer(), 0, termAtt.length());
analyzeVersion(version);
String[] toAnalyze = version.split("[_-]");
if (toAnalyze.length > 1) { //ensure we analyze the whole string as one too
analyzeVersion(version);
}
for (String str : toAnalyze) {
analyzeVersion(version);
}
}
return addTerm();
}