Usage
Signature:
interface TextFilterDef
Generic Parameters
Parameter Description D Type of Data
Typescript Import Format
//To use this interface, import as below.
import {TextFilterDef} from "ojs/ojdataprovider";
For additional information visit:
Fields
-
(nullable) matchBy :('phrase'|'startsWith'|'contains'|'fuzzy'|'unknown')
-
Specifies the text filter matching mechanism.
- 'phrase' - matches phrases at the beginning of the words case insensitively and enforces the relative order
- 'startsWith' - case-insensitive starts with
- 'contains' - case-insensitve contains
- 'fuzzy' - uses TextFilter's fuzzy matching mechanism
- 'unknown' - uses TextFilter's default matching mechanism
- Default Value:
'unknown'
- Since:
- 14.1.0
Examples
1. Filter definition with filter for text "engineer" and "contains" matchBy mechanism.
Sample matching cases: "Bioengineer", "Engineer Director", "Department of Engineering".{text: 'engineer', matchBy: 'contains'}
2. Filter definition with filter for text "engineer" and "phrase" matchBy mechanism.
Sample matching cases: "Engineer Director", "Department of Engineering".
Note: "Bioengineer" is not a match, because it does not match "engineer" at the beginning of the word.{text: 'engineer', matchBy: 'phrase'}
3. Filter definition with filter for text "aero engineer" and "phrase" matchBy mechanism.
Sample matching case: "Senior Aerospace Research Engineer".
Note: "Engineer in Aerospace" is not a match, because "aero" does not come before "engineer".{text: 'aero engineer', matchBy: 'phrase'}
-
text :string
-
Specifies the text to filter for. It is up to the DataProvider implementation to decide which attributes to apply the filter to and also the exact filtering logic used, such as case insensitivity, etc. In addition, for attributes which contain non-string values, the type coercion rule expected is to call toString() on that value. If the value is an object which does not have a string representation then the value does not satisfy the filter.
- Since:
- 8.0.0
Example
Filter definition which filters on the text 'abc search'
{text: 'abc search'}