FilterBuilder Class |
// create some simple attribute filters Filter a = FilterBuilder.Attribute("artist", "Presley"); Filter b = FilterBuilder.Attribute("song", "Jumpin' Jack Flash"); Filter c = FilterBuilder.Attribute("description", "Rock nostalgia"); Console.WriteLine("Created some attribute filters:"); Console.WriteLine(a); Console.WriteLine(b); Console.WriteLine(c); Console.WriteLine(); // lets combine them Filter kingOfRock = FilterBuilder.And(a, c); Console.WriteLine(kingOfRock); Filter classic = FilterBuilder.And(b, c); Console.WriteLine(classic); Filter justCool = FilterBuilder.Or(a, b); Console.WriteLine(justCool); Filter coolOldie = FilterBuilder.And(justCool, c); Console.WriteLine(coolOldie); Console.WriteLine(); // lets add some more stuff into the mix Filter lamers = FilterBuilder.Attribute("artist", "Sofarock"); lamers = FilterBuilder.Or(lamers, FilterBuilder.Attribute("artist", "amazonics")); Filter noLamers = FilterBuilder.Not(lamers); Console.WriteLine(noLamers); // combine more than 2 filters at once by simply supplying them all Filter theOriginal = FilterBuilder.And(classic, noLamers, c); Console.WriteLine(theOriginal);
Namespace: Apptus.ESales.Connector
public static class FilterBuilder
The FilterBuilder type exposes the following members.
Name | Description | |
---|---|---|
And(Filter) |
Create a new AND filter to match the intersection of results that each of the specified operands
would return.
| |
And(Filter, Filter) |
Create a new AND filter to match the intersection of results that f1 and f2 would return.
| |
Attribute(String, String) |
Create a new ATTRIBUTE filter, limiting the result to products where all processed parts
(after tokenization and normalization) of the specified value are present within
the given attribute.
| |
Attribute(String, String) |
Create a new ATTRIBUTE filter, limiting the result to products where all processed parts
(after tokenization and normalization) of the specified value are present within
the given attribute.
| |
Empty |
Returns a EMPTY filter representing no results.
| |
FromString(String) |
Create a new filter, limiting the result to products inside the specified filter. Parentheses will be added if this filter is part of a composite filter.
| |
FromString(String, Boolean) |
Create a new filter, limiting the result to products inside the specified filter.
| |
Incremental(String, String) |
Create a new INCREMENTAL filter, limiting the result to products where all processed parts
(after tokenization and normalization) of the specified value are present within
the given attribute. The last value token matches if any attribute contains
a value to which it is a prefix (after tokenization).
| |
Incremental(String, String) |
Create a new INCREMENTAL filter, limiting the result to products where all processed parts
(after tokenization and normalization) of the specified value are present within
the given attribute. The last value token matches if any attribute contains
a value to which it is a prefix (after tokenization).
| |
Not |
Create a new NOT filter matching every result that the given operand doesn't match.
| |
Or(Filter) |
Create a new OR filter to match the union of results that each of the specified operands
would return.
| |
Or(Filter, Filter) |
Create a new OR filter to match the union of the results that f1 and f2 would return.
| |
Range(String, String, String) |
Create a new RANGE filter, limiting the result to values between from (inclusive)and to (exclusive),
for the specified attribute.
| |
Range(String, String, String) |
Create a new RANGE filter, limiting the result to values between from (inclusive)and to (exclusive),
for the specified attribute.
| |
Range(String, String, String, Boolean, Boolean) |
Create a new RANGE filter, limiting the result to values between from and to,
for the specified attribute. Whether or not the bounds should be considered
inclusive or exclusive is determined by the specified fromInc and toInc parameters.
| |
Range(String, String, String, Boolean, Boolean) |
Create a new RANGE filter, limiting the result to values between from and to,
for the specified attribute. Whether or not the bounds should be considered
inclusive or exclusive is determined by the specified fromInc and toInc parameters.
| |
Universe |
Return a UNIVERSE filter representing all results.
|