Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #164 from Elvex/master
Browse files Browse the repository at this point in the history
added support for field names with escaped spaces
  • Loading branch information
Robert Newson committed Jul 10, 2012
2 parents 70fc175 + f314052 commit 56f9c81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -26,7 +26,7 @@


public final class TypedField { 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; private final String name;


Expand Down
Expand Up @@ -77,6 +77,12 @@ public void fieldNameWithDashes() throws Exception {
assertThat(q, is(TermQuery.class)); 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 { private long time(final String str) throws ParseException {
return FieldType.toDate(str); return FieldType.toDate(str);
} }
Expand Down

0 comments on commit 56f9c81

Please sign in to comment.