Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added support for field names with escaped spaces

  • Loading branch information...
commit f314052420fde76818d66592f0470738a77497f7 1 parent 70fc175
@Roger Roger authored
View
2  src/main/java/com/github/rnewson/couchdb/lucene/TypedField.java
@@ -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;
View
6 src/test/java/com/github/rnewson/couchdb/lucene/CustomQueryParserTest.java
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.