Anomaly identified by the detector. Please review whether this anomaly corresponds to a misuse.
Finding:
10
In File:
org/apache/lucene/search/PhraseQuery.java
In Method:
add(Term, int)
Code with Finding:
class PhraseQuery {
/**
* Adds a term to the end of the query phrase.
* The relative position of the term within the phrase is specified explicitly.
* This allows e.g. phrases with more than one term at the same position
* or phrases with gaps (e.g. in connection with stopwords).
*
* @param term
* @param position
*/
public void add(Term term, int position) {
if (terms.size() == 0)
field = term.field();
else if (term.field() != field)
throw new IllegalArgumentException("All phrase terms must be in the same field: " + term);
terms.add(term);
positions.add(new Integer(position));
if (position > maxPosition) maxPosition = position;
}
}