Whether this gambit can use logical operators.
For example, the tag gambit can be used as such:
tag:foo,bar tag:baz which translates to (foo OR bar) AND baz.
The info allows generation of the correct filtering format, which would be
{ tag: [ 'foo,bar', // OR because of the comma. 'baz', // AND because it's a separate item. ] }
The backend filter must be able to handle this format.
Checkout the TagGambit and TagFilter classes for an example.
This is the server standardised filter key for this gambit.
The filter key must not be localized.
Returns string
filterValueToGambitValue
filterValueToGambitValue(value): string
Parameters
value: any
Returns string
fromFilter
fromFilter(value, negate): string
This is the method to transform a filter into a gambit format.
The gambit format can be localized.
Parameters
value: any
negate: boolean
Returns string
gambitValueToFilterValue
gambitValueToFilterValue(value): string | number | boolean | any[]
Parameters
value: string
Returns string | number | boolean | any[]
Abstracthint
hint(): string
Returns string
Abstractkey
key(): string
Returns string
pattern
pattern(): string
This is the regular expression pattern that will be used to match the gambit.
The pattern language can be localized. for example, the pattern for the
author gambit is author:(.+) in English, but auteur:(.+) in
French.
Returns string
suggestion
suggestion(): { hint: string; key: string; }
This returns information about how the gambit is structured for the UI.
Use localized values.
Whether this gambit can use logical operators. For example, the tag gambit can be used as such:
tag:foo,bar tag:baz
which translates to(foo OR bar) AND baz
.The info allows generation of the correct filtering format, which would be
The backend filter must be able to handle this format. Checkout the TagGambit and TagFilter classes for an example.