You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by "Ben Schiefer (Jira)" <ji...@apache.org> on 2020/09/14 20:24:00 UTC
[jira] [Created] (UNOMI-372) Documentation not aligned with
implementation for booleanCondition
Ben Schiefer created UNOMI-372:
----------------------------------
Summary: 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
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)