Skip to content

Commit

Permalink
RegexpQueryParser takes a String as value like its Builder
Browse files Browse the repository at this point in the history
Relates #11896
Closes #12200
  • Loading branch information
alexksikes committed Jul 16, 2015
1 parent 380648a commit d0256da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -468,7 +468,7 @@ public Query prefixQuery(Object value, @Nullable MultiTermQuery.RewriteMethod me
return query;
}

public Query regexpQuery(Object value, int flags, int maxDeterminizedStates, @Nullable MultiTermQuery.RewriteMethod method, @Nullable QueryParseContext context) {
public Query regexpQuery(String value, int flags, int maxDeterminizedStates, @Nullable MultiTermQuery.RewriteMethod method, @Nullable QueryParseContext context) {
RegexpQuery query = new RegexpQuery(createTerm(value), flags, maxDeterminizedStates);
if (method != null) {
query.setRewriteMethod(method);
Expand Down
Expand Up @@ -201,7 +201,7 @@ public Query prefixQuery(Object value, @Nullable MultiTermQuery.RewriteMethod me
}

@Override
public Query regexpQuery(Object value, int flags, int maxDeterminizedStates, @Nullable MultiTermQuery.RewriteMethod method, @Nullable QueryParseContext context) {
public Query regexpQuery(String value, int flags, int maxDeterminizedStates, @Nullable MultiTermQuery.RewriteMethod method, @Nullable QueryParseContext context) {
if (indexOptions() != IndexOptions.NONE || context == null) {
return super.regexpQuery(value, flags, maxDeterminizedStates, method, context);
}
Expand Down
Expand Up @@ -57,7 +57,7 @@ public Query parse(QueryParseContext parseContext) throws IOException, QueryPars
String fieldName = parser.currentName();
String rewriteMethod = null;

Object value = null;
String value = null;
float boost = 1.0f;
int flagsValue = DEFAULT_FLAGS_VALUE;
int maxDeterminizedStates = Operations.DEFAULT_MAX_DETERMINIZED_STATES;
Expand All @@ -76,7 +76,7 @@ public Query parse(QueryParseContext parseContext) throws IOException, QueryPars
currentFieldName = parser.currentName();
} else {
if ("value".equals(currentFieldName)) {
value = parser.objectBytes();
value = parser.textOrNull();
} else if ("boost".equals(currentFieldName)) {
boost = parser.floatValue();
} else if ("rewrite".equals(currentFieldName)) {
Expand All @@ -100,7 +100,7 @@ public Query parse(QueryParseContext parseContext) throws IOException, QueryPars
queryName = parser.text();
} else {
fieldName = currentFieldName;
value = parser.objectBytes();
value = parser.textOrNull();
}
}
}
Expand Down

0 comments on commit d0256da

Please sign in to comment.