Permalink
Browse files

add TextQuery with analyzer

  • Loading branch information...
wangdong
wangdong committed Apr 11, 2012
1 parent ffa03ed commit 7857f7924a896fb4ad612401a5a30874df94eaf0
@@ -62,11 +62,14 @@ public static SpanTerm spanTerm(String field, String value, Double boost) {
return new SpanTerm(field, value, boost);
}
public static TextQuery textQuery(String field, String text, Operator operator, Type type, double boost) {
- return new TextQuery(field, text, operator, type, boost);
+ return new TextQuery(field, text, operator, type, boost, null);
}
public static TextQuery textQuery(String field, String text, Operator operator, double boost) {
- return new TextQuery(field, text, operator, null, boost);
- }
+ return new TextQuery(field, text, operator, null, boost, null);
+ }
+ public static TextQuery textQuery(String field, String text, Operator operator, double boost, String analyzer) {
+ return new TextQuery(field, text, operator, null, boost, analyzer);
+ }
public static FilteredQuery filteredQuery(Query query, Filter filter, double boost) {
return new FilteredQuery(query, filter, boost);
}
@@ -135,14 +135,16 @@
private Operator operator;
private Type type;
private double boost;
+ private String analyzer;
- public TextQuery(String field, String value, Operator operator, Type type, double boost) {
+ public TextQuery(String field, String value, Operator operator, Type type, double boost, String analyzer) {
super();
this.field = field;
this.value = value;
this.operator = operator;
this.type = type;
this.boost = boost;
+ this.analyzer = analyzer;
}
public static enum Type {
@@ -170,4 +172,7 @@ public double getBoost() {
return boost;
}
+ public String getAnalyzer() {
+ return analyzer;
+ }
}

0 comments on commit 7857f79

Please sign in to comment.