-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the `StaticFilter` interface to only allow combinations of filters supported by the backend. After talking with Watson, only `AND`s of `OR`s (conjunctions of disjunctions), or structures that can be trivially converted to such, are accepted. To reflect this, `ConjunctionStaticFilter` and `DisjunctionStaticFilter` models were created, with the latter having limitations on which filters it can combine so a disjunction of conjunctions is not allowed. Also, I added some Jest tests for a couple more edge cases that were being missed when serializing a static filter. J=SLAP-2325 TEST=auto, manual See that the new and existing Jest tests pass. Spin up the test-site and successfully fire vertical searches with static filters defined with the new interface.
- Loading branch information
Showing
20 changed files
with
395 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [ConjunctionStaticFilter](./search-core.conjunctionstaticfilter.md) > [combinator](./search-core.conjunctionstaticfilter.combinator.md) | ||
|
||
## ConjunctionStaticFilter.combinator property | ||
|
||
Indicates that filters should be combined with a logical AND. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
combinator: FilterCombinator.AND; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [ConjunctionStaticFilter](./search-core.conjunctionstaticfilter.md) > [filters](./search-core.conjunctionstaticfilter.filters.md) | ||
|
||
## ConjunctionStaticFilter.filters property | ||
|
||
The filters to combine together. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
filters: StaticFilter[]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [ConjunctionStaticFilter](./search-core.conjunctionstaticfilter.md) > [kind](./search-core.conjunctionstaticfilter.kind.md) | ||
|
||
## ConjunctionStaticFilter.kind property | ||
|
||
The kind of static filter. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
kind: 'conjunction'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [ConjunctionStaticFilter](./search-core.conjunctionstaticfilter.md) | ||
|
||
## ConjunctionStaticFilter interface | ||
|
||
A static filter composed by combining other static filters with the logical AND operator. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface ConjunctionStaticFilter | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [combinator](./search-core.conjunctionstaticfilter.combinator.md) | [FilterCombinator.AND](./search-core.filtercombinator.md) | Indicates that filters should be combined with a logical AND. | | ||
| [filters](./search-core.conjunctionstaticfilter.filters.md) | [StaticFilter](./search-core.staticfilter.md)<!-- -->\[\] | The filters to combine together. | | ||
| [kind](./search-core.conjunctionstaticfilter.kind.md) | 'conjunction' | The kind of static filter. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [DisjunctionStaticFilter](./search-core.disjunctionstaticfilter.md) > [combinator](./search-core.disjunctionstaticfilter.combinator.md) | ||
|
||
## DisjunctionStaticFilter.combinator property | ||
|
||
Indicates that filters should be combined with a logical OR. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
combinator: FilterCombinator.OR; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [DisjunctionStaticFilter](./search-core.disjunctionstaticfilter.md) > [filters](./search-core.disjunctionstaticfilter.filters.md) | ||
|
||
## DisjunctionStaticFilter.filters property | ||
|
||
The filters to combine together. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
filters: (DisjunctionStaticFilter | FieldValueStaticFilter)[]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [DisjunctionStaticFilter](./search-core.disjunctionstaticfilter.md) > [kind](./search-core.disjunctionstaticfilter.kind.md) | ||
|
||
## DisjunctionStaticFilter.kind property | ||
|
||
The kind of static filter. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
kind: 'disjunction'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [DisjunctionStaticFilter](./search-core.disjunctionstaticfilter.md) | ||
|
||
## DisjunctionStaticFilter interface | ||
|
||
A static filter composed by combining filters with the logical OR operator. The combined filters can either be field value filters or other disjunction filters. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface DisjunctionStaticFilter | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [combinator](./search-core.disjunctionstaticfilter.combinator.md) | [FilterCombinator.OR](./search-core.filtercombinator.md) | Indicates that filters should be combined with a logical OR. | | ||
| [filters](./search-core.disjunctionstaticfilter.filters.md) | ([DisjunctionStaticFilter](./search-core.disjunctionstaticfilter.md) \| [FieldValueStaticFilter](./search-core.fieldvaluestaticfilter.md)<!-- -->)\[\] | The filters to combine together. | | ||
| [kind](./search-core.disjunctionstaticfilter.kind.md) | 'disjunction' | The kind of static filter. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [FieldValueStaticFilter](./search-core.fieldvaluestaticfilter.md) > [kind](./search-core.fieldvaluestaticfilter.kind.md) | ||
|
||
## FieldValueStaticFilter.kind property | ||
|
||
The kind of static filter. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
kind: 'fieldValue'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [FieldValueStaticFilter](./search-core.fieldvaluestaticfilter.md) | ||
|
||
## FieldValueStaticFilter interface | ||
|
||
A [FieldValueFilter](./search-core.fieldvaluefilter.md) with the kind of filter specified to discriminate between static filter types. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface FieldValueStaticFilter extends FieldValueFilter | ||
``` | ||
<b>Extends:</b> [FieldValueFilter](./search-core.fieldvaluefilter.md) | ||
## Properties | ||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [kind](./search-core.fieldvaluestaticfilter.kind.md) | 'fieldValue' | The kind of static filter. | | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.