Skip to content

Commit a39ffaf

Browse files
committed
Add support for wildcard field type
This adds support for the "wildcard" field type that supports efficient execution of wildcard and prefix queries by matching first against trigrams (or bigrams or individual characters), then post-filtering by evaluating the original field value against the pattern. It also supports post-filtering by regexp queries, but doesn't yet have an efficient first-phase approximation. (For general regex queries, we'll probably never have a "good" first-phase approximation.) Signed-off-by: Michael Froh <froh@amazon.com>
1 parent 84ad3a7 commit a39ffaf

File tree

5 files changed

+914
-1
lines changed

5 files changed

+914
-1
lines changed

server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ protected void parseCreateField(ParseContext context) throws IOException {
703703
}
704704
}
705705

706-
private static String normalizeValue(NamedAnalyzer normalizer, String field, String value) throws IOException {
706+
static String normalizeValue(NamedAnalyzer normalizer, String field, String value) throws IOException {
707707
try (TokenStream ts = normalizer.tokenStream(field, value)) {
708708
final CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class);
709709
ts.reset();

0 commit comments

Comments
 (0)