Skip to content

WebDSL-Search.sdf3

pdmosses/webdsl-statix/webdslstatix/syntax/WebDSL-Search.sdf3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
module 

imports
  WebDSL-Action
  WebDSL-Core
  WebDSL-Lexical
  WebDSL-DataModel

lexical sorts

  SA-Value   SEARCHERREF

context-free sorts

  FullTextAnalyzerBody  CharFilter Tokenizer
  TokenFilter AnalyzerArgument OptDefaultAnalyzer 

context-free syntax

  Definition.FullTextAnalyzer = <
    <OptDefaultAnalyzer> analyzer <Id> {
      <FullTextAnalyzerBody>
    }
  >

  OptDefaultAnalyzer.NonDefaultAnalyzer     = <>
  OptDefaultAnalyzer.DefaultAnalyzer        = <default>
  OptDefaultAnalyzer.DefaultBuiltInAnalyzer = <default_builtin_analyzer>

  FullTextAnalyzerBody.FullTextAnalyzerBody = <
    <FullTextAnalyzerBodyDef>
  >
  FullTextAnalyzerBody.DualFullTextAnalyzerBody = <
    index {
      <FullTextAnalyzerBodyDef>
    }
    query {
      <FullTextAnalyzerBodyDef>
    }>

  .FullTextAnalyzerBodyDef = <
    <CharFilter*>
    <Tokenizer>
    <TokenFilter*>
  >

  CharFilter.CharFilter = <
    char filter = <Id> <OptAnalyzerArguments>
  >
  Tokenizer.Tokenizer = <
    tokenizer = <Id> <OptAnalyzerArguments>
  >
  TokenFilter.TokenFilter = <
    token filter = <Id> <OptAnalyzerArguments>
  >

  .OptAnalyzerArgumentsNone = <>
  .AnalyzerArguments = <( <{AnalyzerArgument ","}*> )>

  AnalyzerArgument.AnalyzerArgument = <<Id> = <String>>

context-free sorts

   SearchNamespaceAnno SA-Argument OptSAArguments SA-Key

context-free syntax

  .SearchableAnno = <searchable <OptSAArguments>>
  SearchNamespaceAnno.SearchNamespaceAnno = <search namespace>
  Annotation.SearchableAnnoBoost = <<SearchableAnno> ^ <Float>>
  Annotation = SearchableAnno
  Annotation = SearchNamespaceAnno

  OptSAArguments.OptSAArgumentsNone = <>
  OptSAArguments.OptSAArguments = <( <{SA-Argument ","}*> )>

  SA-Argument.SA-Argument           = <<SA-Key> = <SA-Value>>
  SA-Argument.Autocomplete-Argument = <autocomplete>
  SA-Argument.Spellcheck-Argument   = <spellcheck>
  SA-Argument.Numeric-Argument      = <numeric>
  SA-Argument.DefaultSF-Argument    = <default>

  SA-Key.SAKeyAnalyzer  = <analyzer>
  SA-Key.SAKeyName      = <name>
  SA-Key.SAKeyBoost     = <boost>
  SA-Key.SAKeySubclass  = <subclass>
  SA-Key.SAKeyDepth     = <depth>

context-free sorts

     SearchMappingAnnoPart

context-free syntax

  Definition.SearchMapping = <
    search mapping <Id> {
      <SearchMappingContent*>
    }
  >

  EntityBodyDeclaration.SearchMappingEmbedded = <
    search mapping {
      <SearchMappingContent*>
    }
  >

  .SearchNamespaceMapping = <
    namespace by <Id>
  >
  .SearchNamespaceMappingAlt = <
    namespace by <Id> ;
  >
  .SearchFieldMapping = <
    <OptDefaultSearchField> <SearchMappingId> <MappingPart*>
  >
  .SearchFieldMappingAlt = <
    <OptDefaultSearchField> <SearchMappingId> <MappingPart*> ;
  >
  .SearchFieldMappingIndex = <
    <OptDefaultSearchField> index <Id> <MappingPart*>
  >
  .SearchFieldMappingIndexAlt = <
    <OptDefaultSearchField> index <Id> <MappingPart*> ;
  >

  .FieldName         = <as <Id>>
  .AnalyzerName      = <using <Id>>
  .BoostAlt          = <boosted to <Float>>
  .TargetEntity      = <for subclass <Id>>
  .SearchMappingAnno = <( <{SearchMappingAnnoPart ","}*> )>
  .EmbeddedDepth     = <depth <Int>>
  .EmbeddedDepthAlt  = <with depth <Int>>
  .Boost             = <^ <Float>>

  SearchMappingAnnoPart.SearchMappingAnnoSpellCheck   = <spellcheck>
  SearchMappingAnnoPart.SearchMappingAnnoAutoComplete = <autocomplete>

  .OptDefaultSearchFieldNone = <>
  .DefaultSearchField        = <+>

lexical sorts

  

lexical syntax

   = Id
   = "as" {reject}
   = "using" {reject}
   = "boosted" {reject}
   = "by" {reject}
   = "with" {reject}
   = "index" {reject}
   = "depth" {reject}
   = "for" {reject}

  SA-Value = Id
  SA-Value = Float
  SA-Value = Int

context-free sorts

    QueryDef Offset  SortBy ConstraintFilter FacetDef SearchAttributes
   SearchAttribute    QuerySearchField QueryConstraint
  QueryBoost   Slop       SortExp Direction
    SuggestType   SuggestionPart OptQueryBoost 
  OptFieldsConstraint  OptDirection GroupDef

context-free syntax

  .SearcherDef = SearcherDef
  .SearcherInit = <search <SimpleSortLex> <SearcherPart*>>
  .SearcherRefMod = <~ <Exp> <SearcherPart+>>
   = ConstraintFilter
   = QueryDef
   = Offset
   = MaxResults
   = SortBy
   = FacetDef
   = SearchAttributes
   = NamespaceConstraint
  QueryDef.QueryDef = <matching <MatchGroup+>>
  Offset.Start = <offset <Exp>>
  .MaxResults = <limit <Exp>>
  SortBy.SortBy = <order by <{SortExp ","}+>>
  ConstraintFilter.ConstraintFilter = <with filter <{FilterConstraint ","}+>>
  ConstraintFilter.ConstraintFilterAlt = <with filters <{FilterConstraint ","}+>>
  FacetDef.FacetDef = <with facet <{FacetExp ","}+>>
  FacetDef.FacetDefAlt = <with facets <{FacetExp ","}+>>
  SearchAttributes.SearchAttributes = <[ <{SearchAttribute ","}+> ]>
  .NamespaceConstraint = <in namespace <Exp>>
  SearchAttribute.NoLucene = <no lucene>
  SearchAttribute.Lucene = <lucene>
  SearchAttribute.DefaultAnd = <strict matching>
  SearchAttribute.DefaultOr = <loose matching>

lexical syntax

  VarId = "nolucene" {reject}
  VarId = "lucene" {reject}
  VarId = "strictmatching" {reject}
  VarId = "loosematching" {reject}

context-free syntax

  .DiscreteFacetDef = <<SearchField> ( <Exp> )>
  .RangeFacetDef = <<SearchField> ( <{Range ","}+> )>
  .FieldFilterConstraint = <<SearchField> : <Exp>>
  .FieldsConstraint = <<{QuerySearchField ","}+> :>
  QuerySearchField.QuerySearchField = <<SearchField> <OptQueryBoost>>
  QueryConstraint.QueryConstraint = <<{QueryExp ","}+>>
  QueryBoost.QueryBoost = <^ <Exp>>
  .Clause = <<OptBoolOp> ( <MatchGroup+> )>
  .Query = <<OptFieldsConstraint> <QueryConstraint>>
  .MatchAllQuery = <* : *>
  .TermDef = <<OptBoolOp> <QueryTerm> <OptSlop>>
  .RangeDef = <<OptBoolOp> <Range>>
  .QueryExpGroupDef = GroupDef
  GroupDef.GroupDef = <<OptBoolOp> ( <QueryExp+> ) <OptSlop>>
  GroupDef = <<OptBoolOp> ( <Exp> ) <OptSlop>> {reject}
  Slop.Slop = <~ <Exp>>
  .Range = <<RangeOpen> <ExpOrWildCard> to <ExpOrWildCard> <RangeClose>>
  .RangeAlt = <<RangeOpen> <ExpOrWildCard> TO <ExpOrWildCard> <RangeClose>>
   = Exp
  .WildCard = <*>
  .ExcludingOpen = <{>
  .ExcludingClose = <}>
  .IncludingOpen = <[>
  .IncludingClose = <]>
  .Must = <+>
  .MustNot = <->
  . = <<Exp>>
   = SearcherDef {reject}

  SortExp.SortDef = <<SearchField> <OptDirection>>
  Direction.AscendingAbbr = <asc>
  Direction.Ascending = <ascending>
  Direction.DescendingAbbr = <desc>
  Direction.Descending = <descending>
  .NormalHighlight = <highlight>
  .HTMLHighlight = <highlightHTML>
  .Highlight = <<Highlight> <SearchField> : <Exp> from <Exp>>
  .HighlightTags = <<Highlight> <SearchField> : <Exp> from <Exp> with tags ( <Exp> , <Exp> )>
  .SearchResults = <results from <Exp>>
  .FacetResults = <<SearchField> facets from <Exp>>
  . = <count from <Exp>>
  .SearchTimeString = <searchtime from <Exp>>
  .Suggest = <<SimpleSortLex> <SuggestType> <SuggestionPart+>>
  SuggestType.AutoComplete = <completions>
  SuggestType.SpellCheck = <corrections>
  .RetrievalExp = RetrievalExp
  .SearchFieldExp = <~ <Exp>>
   = PlainField
  .SearchFieldPlainBase = SearchFieldId
  .SearchFieldPlain = <<SearchFieldId> . <PlainField>>
  SuggestionPart.Similarity = <similarity <Exp>>
  SuggestionPart.SuggestTerm = <matching <FieldsConstraint> <Exp>>
  SuggestionPart = NamespaceConstraint
  SuggestionPart = MaxResults

context-free priorities

  RetrievalExp.SearchResultsSize <2> .> Exp.Eq,
  RetrievalExp.SearchResultsSize <2> .> Exp.NotEq,
  RetrievalExp.SearchResultsSize <2> .> Exp.LargerThan,
  RetrievalExp.SearchResultsSize <2> .> Exp.LargerThanOrEqual,
  RetrievalExp.SearchResultsSize <2> .> Exp.SmallerThan,
  RetrievalExp.SearchResultsSize <2> .> Exp.SmallerThanOrEqual

context-free syntax

   = SearcherKW {reject}
   = <<SearcherKW> ( <Exp> )> {reject}
   = <[ <{Exp ","}*> ]> {reject}

  OptQueryBoost.OptQueryBoostNone = <>
  OptQueryBoost = QueryBoost
  .OptBoolOpNone = <>
   = BoolOp
  OptFieldsConstraint.OptFieldsConstraintNone = <>
  OptFieldsConstraint = FieldsConstraint
  .OptSlopNone = <>
   = Slop
  OptDirection.OptDirectionNone = <>
  OptDirection = Direction

context-free priorities

  QueryTerm.QueryTermExp <0> .> Exp.Sub,
  QueryTerm.QueryTermExp <0> .> Exp.Add

context-free restrictions

  BoolOp -/- [0-9]
  QueryTerm -/- [\(]

lexical syntax

   = Id
   = "_id"
  SEARCHERREF = Id
   = "limit"
   = "offset"
   = "with"
   = "order"
   = "in"
   = "matching"

lexical restrictions

  "as"
  "asc"
  "ascending"
  "analyzer"
  "autocomplete"
  "boost"
  "boosted"
  "by" -/- [a-zA-Z0-9]
  "desc"
  "descending"
  "default"
  "default_builtin_analyzer"
  "depth"
  "extend"
  "for" -/- [a-zA-Z0-9]
  "facet"
  "facets"
  "from"
  "get"
  "highlight"
  "index"
  "limit" -/- [a-zA-Z0-9]
  "matching"
  "name"
  "namespace"
  "nolucene"
  "on"
  "query" -/- [a-zA-Z0-9]
  "results"
  "search"
  "sort"
  "spellcheck"
  "start"
  "subclass" -/- [a-zA-Z0-9]
  "using"
  "with"
  "where" -/- [a-zA-Z0-9]

context-free syntax

  EntityBodyDeclaration.SearchMappingEmbeddedDepr = <
    searchmapping {
      <SearchMappingContent*>
    }
  > {deprecated("keyword `searchmapping` is replaced with `search mapping`")}
  Definition.SearchMappingDepr = <
    searchmapping <Id> {
      <SearchMappingContent*>
    }
  > {deprecated("keyword `searchmapping` is replaced with `search mapping`")}
  CharFilter.CharFilterDepr = <charfilter = <Id> <OptAnalyzerArguments>> {deprecated("keyword `charfilter` is replaced with `char filter`")}
  TokenFilter.TokenFilterDepr = <tokenfilter = <Id> <OptAnalyzerArguments>> {deprecated("keyword `tokenfilter` is replaced with `token filter`")}
  .AllFacetResults = <all <SearchField> facets from <Exp>> {deprecated("the `all` keyword has been deprecated and has no effect on facet retrieval anymore")}
  .DiscreteFacetDefDepr = <( <SearchField> , <Exp> )> {deprecated("the notation: (field,topN) has been replaced with field(topN) ")}
  .RangeFacetDefDepr = <( <SearchField> : <{Range ","}+> )> {deprecated("the notation: (field:[min to max], ...) has been replaced with field([min to max], ...) ")}