summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2020-01-27 21:30:26 +0100
committerJon Bratseth <bratseth@verizonmedia.com>2020-01-27 21:30:26 +0100
commit9694c1d69e82edf8ce14c73b1dafcb57a9e07169 (patch)
tree3966e1522eecbce8f0b50ed14c950b6d89bb729c /config-model
parent21093f7aebd776713e2c369a4e9c5cf235c0d2f2 (diff)
Allow fieldset settings in any order
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/javacc/SDParser.jj34
-rw-r--r--config-model/src/test/derived/indexschema/indexschema.sd2
2 files changed, 18 insertions, 18 deletions
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj
index 9468ce47a2c..9b49fd50749 100644
--- a/config-model/src/main/javacc/SDParser.jj
+++ b/config-model/src/main/javacc/SDParser.jj
@@ -651,27 +651,27 @@ void field(SDDocumentType document, Search search) :
void fieldSet(Search search) :
{
- String name;
-}
-{
- <FIELDSET> name = identifier() lbrace()
- (fieldSetItem(name, search)(<NL>)*)+
- <RBRACE>
-}
-
-void fieldSetItem(String setName, Search search) :
-{
+ String setName;
String field;
String queryCommand;
- SDField matchSettings = new SDField(setName, DataType.STRING); // match etc for fieldset represented as SDField or ease of parsing
+ List queryCommands = new ArrayList();
+ SDField matchSettings;
}
{
- ( <FIELDS><COLON> field=identifier() { search.fieldSets().addUserFieldSetItem(setName, field); }
- ( <COMMA> field=identifier() { search.fieldSets().addUserFieldSetItem(setName, field); } )* )
- |
- ( <QUERYCOMMAND> <COLON> (queryCommand = identifierWithDash() | queryCommand = quotedString())) { search.fieldSets().userFieldSets().get(setName).queryCommands().add(queryCommand);}
- |
- ( match(matchSettings) ) { matchSettings.applyOperations(); search.fieldSets().userFieldSets().get(setName).setMatching(matchSettings.getMatching());}
+ <FIELDSET> setName = identifier() lbrace() { matchSettings = new SDField(setName, DataType.STRING); }
+ ((
+ ( <FIELDS><COLON> field=identifier() { search.fieldSets().addUserFieldSetItem(setName, field); }
+ ( <COMMA> field=identifier() { search.fieldSets().addUserFieldSetItem(setName, field); } )* )
+ |
+ ( <QUERYCOMMAND> <COLON> (queryCommand = identifierWithDash() | queryCommand = quotedString())) { queryCommands.add(queryCommand); }
+ |
+ ( match(matchSettings) ) { matchSettings.applyOperations(); search.fieldSets().userFieldSets().get(setName).setMatching(matchSettings.getMatching());}
+ )(<NL>)*)+
+ <RBRACE>
+ {
+ for (Object command : queryCommands)
+ search.fieldSets().userFieldSets().get(setName).queryCommands().add((String)command);
+ }
}
/**
diff --git a/config-model/src/test/derived/indexschema/indexschema.sd b/config-model/src/test/derived/indexschema/indexschema.sd
index d0773accf33..010eb8ec3e8 100644
--- a/config-model/src/test/derived/indexschema/indexschema.sd
+++ b/config-model/src/test/derived/indexschema/indexschema.sd
@@ -131,8 +131,8 @@ search indexschema {
}
fieldset exactexplicit {
- fields:sa, sb
query-command: "exact ARNOLD"
+ fields:sa, sb
query-command: dynteaser
}