interned comparison comments

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@520891 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2007-03-21 13:58:47 +00:00
parent e09189a830
commit 14d70e9be7
3 changed files with 4 additions and 3 deletions

View File

@ -70,7 +70,7 @@ abstract class PrefixGenerator implements IdGenerator {
Term term = enumerator.term(); Term term = enumerator.term();
if (term != null && if (term != null &&
term.text().startsWith(prefixText) && term.text().startsWith(prefixText) &&
term.field() == prefixField) term.field() == prefixField) // interned comparison
{ {
termDocs.seek(term); termDocs.seek(term);
while (termDocs.next()) { while (termDocs.next()) {

View File

@ -47,7 +47,8 @@ public class PrefixQuery extends Query {
Term term = enumerator.term(); Term term = enumerator.term();
if (term != null && if (term != null &&
term.text().startsWith(prefixText) && term.text().startsWith(prefixText) &&
term.field() == prefixField) { term.field() == prefixField) // interned comparison
{
TermQuery tq = new TermQuery(term); // found a match TermQuery tq = new TermQuery(term); // found a match
tq.setBoost(getBoost()); // set the boost tq.setBoost(getBoost()); // set the boost
query.add(tq, BooleanClause.Occur.SHOULD); // add to query query.add(tq, BooleanClause.Occur.SHOULD); // add to query

View File

@ -91,7 +91,7 @@ public class RangeQuery extends Query
do { do {
Term term = enumerator.term(); Term term = enumerator.term();
if (term != null && term.field() == testField) { if (term != null && term.field() == testField) { // interned comparison
if (!checkLower || term.text().compareTo(lowerTerm.text()) > 0) { if (!checkLower || term.text().compareTo(lowerTerm.text()) > 0) {
checkLower = false; checkLower = false;
if (upperTerm != null) { if (upperTerm != null) {