Permalink
Browse files

added support for field names with escaped spaces

  • Loading branch information...
Roger committed Jul 10, 2012
1 parent 70fc175 commit f314052420fde76818d66592f0470738a77497f7
@@ -26,7 +26,7 @@
public final class TypedField {
- private static Pattern PATTERN = Pattern.compile("^(\\w[\\w_.-]*)(<([\\w]+)>)?$");
+ private static Pattern PATTERN = Pattern.compile("^(\\w[\\\\ \\w_.-]*)(<([\\w]+)>)?$");
private final String name;
@@ -77,6 +77,12 @@ public void fieldNameWithDashes() throws Exception {
assertThat(q, is(TermQuery.class));
}
+ @Test
+ public void fieldNameWithEscapedSpaces() throws Exception {
+ final Query q = parser.parse("foo\\ bar:baz");
+ assertThat(q, is(TermQuery.class));
+ }
+
private long time(final String str) throws ParseException {
return FieldType.toDate(str);
}

0 comments on commit f314052

Please sign in to comment.