mirror of
https://github.com/apache/lucene.git
synced 2025-03-08 01:25:19 +00:00
[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:
parent
bc3a3dc5d4
commit
ae25687579
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user