You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by "Serge Huber (Jira)" <ji...@apache.org> on 2020/09/15 09:21:00 UTC
[jira] [Commented] (UNOMI-372) Documentation not aligned with
implementation for booleanCondition
[ https://issues.apache.org/jira/browse/UNOMI-372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17196004#comment-17196004 ]
Serge Huber commented on UNOMI-372:
-----------------------------------
Actually this is a problem in the documentation. I don't think it makes sense to have a "not" operator on a booleanCondition. There is however a "notCondition" type which can be used inside a booleanCondition as a sub condition.
But it is true that conditions in general could be better documented.
> Documentation not aligned with implementation for booleanCondition
> ------------------------------------------------------------------
>
> Key: UNOMI-372
> URL: https://issues.apache.org/jira/browse/UNOMI-372
> Project: Apache Unomi
> Issue Type: Bug
> Components: core
> Affects Versions: 1.5.1
> Reporter: Ben Schiefer
> Priority: Major
>
> The documentation eludes to the fact that one may use the "not" value for the operator in a booleanCondition. This does not seem to be the case, (at least for the profile/count endpoint, anyway.)
>
> Documentation Link: [https://github.com/apache/unomi/blob/bacb7bc3fe1abac08739d249715f844dc0829fe6/manual/src/main/asciidoc/datamodel.adoc#condition]
>
> Text in question: "Apache Unomi provides quite a lot of built-in condition types, including boolean types that make it possible to compose conditions using operators such as {{and}}, {{or}} or {{not}}. Composition is an essential element of building more complex conditions."
>
> POST /cxs/query/profile/count
> ```
> {
> "parameterValues": {
> "subConditions": [
> {
> "parameterValues": {
> "propertyName": "properties.firstName",
> "comparisonOperator": "equals",
> "propertyValue": "jeff"
> },
> "type": "profilePropertyCondition"
> }
> ],
> "operator": "not"
> },
> "type": "booleanCondition"
> }
> ```
> There are 705 total documents in my context-profile index, with only one of the documents containing properties.firstName === 'jeff'.
> I would expect the request above to return a count of 704, as that's what i get when i query elastic directly with the "must_not" clause. However, I always get the same count for "not" operator as i get with "and" operator (which is 1).
>
> Furthermore, it appears that ANY value for operator other than "or" is treated as an "and". Example -> if I pass operator: "foo", I still get a count of 1.
>
> Recommendation:
> - Preferred: Support "not" operator
> - Else: Update documentation to reflect only support for "or" and "and" operator on booleanCondition
--
This message was sent by Atlassian Jira
(v8.3.4#803005)