summaryrefslogtreecommitdiffstats
path: root/indexinglanguage/src/main/javacc/IndexingParser.jj
diff options
context:
space:
mode:
Diffstat (limited to 'indexinglanguage/src/main/javacc/IndexingParser.jj')
-rw-r--r--indexinglanguage/src/main/javacc/IndexingParser.jj16
1 files changed, 16 insertions, 0 deletions
diff --git a/indexinglanguage/src/main/javacc/IndexingParser.jj b/indexinglanguage/src/main/javacc/IndexingParser.jj
index 632a19a2c6c..4533a17954c 100644
--- a/indexinglanguage/src/main/javacc/IndexingParser.jj
+++ b/indexinglanguage/src/main/javacc/IndexingParser.jj
@@ -34,6 +34,7 @@ import com.yahoo.text.StringUtilities;
import com.yahoo.vespa.indexinglanguage.expressions.*;
import com.yahoo.vespa.indexinglanguage.linguistics.AnnotatorConfig;
import com.yahoo.language.process.StemMode;
+import com.yahoo.language.process.Encoder;
import com.yahoo.language.Linguistics;
/**
@@ -44,6 +45,7 @@ public class IndexingParser {
private String defaultFieldName;
private Linguistics linguistics;
+ private Encoder encoder;
private AnnotatorConfig annotatorCfg;
public IndexingParser(String str) {
@@ -60,6 +62,11 @@ public class IndexingParser {
return this;
}
+ public IndexingParser setEncoder(Encoder encoder) {
+ this.encoder = encoder;
+ return this;
+ }
+
public IndexingParser setAnnotatorConfig(AnnotatorConfig cfg) {
annotatorCfg = cfg;
return this;
@@ -150,6 +157,7 @@ TOKEN :
<CREATE_IF_NON_EXISTENT: "create_if_non_existent"> |
<ECHO: "echo"> |
<ELSE: "else"> |
+ <ENCODE: "encode"> |
<EXACT: "exact"> |
<FLATTEN: "flatten"> |
<FOR_EACH: "for_each"> |
@@ -275,6 +283,7 @@ Expression value() :
val = base64EncodeExp() |
val = clearStateExp() |
val = echoExp() |
+ val = encodeExp() |
val = exactExp() |
val = flattenExp() |
val = forEachExp() |
@@ -356,6 +365,12 @@ Expression echoExp() : { }
{ return new EchoExpression(); }
}
+Expression encodeExp() : { }
+{
+ ( <ENCODE> )
+ { return new EncodeExpression(encoder); }
+}
+
Expression exactExp() : { }
{
( <EXACT> )
@@ -729,6 +744,7 @@ String identifier() :
<ECHO> |
<EXACT> |
<ELSE> |
+ <ENCODE> |
<FLATTEN> |
<FOR_EACH> |
<GET_FIELD> |