[SOLR-3550] - remove useless switches on the always true enablePosIncr

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1344775 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tommaso Teofili 2012-05-31 15:25:57 +00:00
parent bc3a3dc5d4
commit ae25687579

View File

@ -168,7 +168,6 @@ public class TextField extends FieldType {
static Query parseFieldQuery(QParser parser, Analyzer analyzer, String field, String queryText) {
int phraseSlop = 0;
boolean enablePositionIncrements = true;
// most of the following code is taken from the Lucene QueryParser
@ -289,21 +288,13 @@ public class TextField extends FieldType {
}
if (positionIncrement > 0 && multiTerms.size() > 0) {
if (enablePositionIncrements) {
mpq.add((Term[])multiTerms.toArray(new Term[0]),position);
} else {
mpq.add((Term[])multiTerms.toArray(new Term[0]));
}
mpq.add((Term[])multiTerms.toArray(new Term[multiTerms.size()]),position);
multiTerms.clear();
}
position += positionIncrement;
multiTerms.add(new Term(field, term));
}
if (enablePositionIncrements) {
mpq.add((Term[])multiTerms.toArray(new Term[0]),position);
} else {
mpq.add((Term[])multiTerms.toArray(new Term[0]));
}
mpq.add((Term[])multiTerms.toArray(new Term[multiTerms.size()]),position);
return mpq;
}
}
@ -329,12 +320,8 @@ public class TextField extends FieldType {
// safe to ignore, because we know the number of tokens
}
if (enablePositionIncrements) {
position += positionIncrement;
pq.add(new Term(field, term),position);
} else {
pq.add(new Term(field, term));
}
position += positionIncrement;
pq.add(new Term(field, term),position);
}
return pq;
}