-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds changes following the release of Query Rules v2. All changes are described in details in the following dedicated sections. **Enabled flag** A new `Enabled` boolean field was added to the `Rule` type. However, one must use the new `Rule.Disable()` and `Rule.Enable()` methods to disable or enable a rule respectively. While setting `Enabled` to `true` manually would effectively enable the rule, setting to `false` would have no effect, the rule would still be implicitly enabled. This is due to the fact that Go booleans default to `false` when uninitialised and because the implementation has to export the field (i.e. making it public) to be able to properly deserialize it. **Time windows** A new `Validity` field was added to the `Rule` type. It allows to provide a slice of `TimeRange` to provide time ranges for which the query rule is active and disable it the rest of the time. `TimeRange` objects holds two `From` and `Until` values of type `time.Time` to configure the range. **Demote (hide) product** Hiding records from a response if a query rule is triggered thanks to the newly introduced `Hide` field of `RuleConsequence`. This field can be filled with a slice of `HiddenObject` that simply contain the object IDs to discard from the response. **Match the empty query** The `Is` anchoring can now be used to match empty queries. As this was not prevented previously and this change is happening on the engine side, no change were made here. **Disjunctive facet filters** The `AutomaticFacetFilter` type has been added to let the user properly fill values for `automaticFacetFilter` and `automaticOptionalFacetFilters`. Tests were also added to check that `automaticFacetFilter` and `automaticOptionalFacetFilters` can still be passed as arrays of string, for backward-compatibility. **Replace word** Add the `Edit` type and its associated constructor functions `DeleteEdit` and `ReplaceEdit`. Those are deprecating the use of the `QueryIncrementalEdit` (Go comment has been updated to reflect the deprecation). **Reporting parameters** The `explain` feature was introduced that let the user ask for explanations (retrieved in the new `Explain` field from search responses) from search queries (using the new `explain` search parameter with the following slice: `[]string{"params.rules"}`).
- Loading branch information
Showing
5 changed files
with
142 additions
and
9 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
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