Permalink
Browse files

Merge pull request #164 from Elvex/master

added support for field names with escaped spaces
  • Loading branch information...
Robert Newson
Robert Newson committed Jul 10, 2012
2 parents 70fc175 + f314052 commit 56f9c81306450dab053bff1cbc13a3fcd0039f95
@@ -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 56f9c81

Please sign in to comment.