[
https://issues.apache.org/jira/browse/UNOMI-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17552369#comment-17552369
]
Kevan Jahanshahi commented on UNOMI-585:
----------------------------------------
What need to be done in the scope of this ticket, resume:
* set profile.properties.interests as nested mapping in the profile.json
mapping template
* Create new *NestedConditionESQueryBuilder* and
{*}NestedConditionEvaluator{*}. to be able to build Segment and Queries on the
nested interests
* Add integration test on the new NestedCondition stuff.
** Scenario: create profile with interests and do queries, segment that will
eval both the ConditionEvaluator and the ESQueryBuilder.
> Use nested mapping for profile.properties.interests
> ---------------------------------------------------
>
> Key: UNOMI-585
> URL: https://issues.apache.org/jira/browse/UNOMI-585
> Project: Apache Unomi
> Issue Type: New Feature
> Affects Versions: 2.0.0
> Reporter: Kevan Jahanshahi
> Priority: Major
> Fix For: 2.0.0
>
>
> We cannot use flattened indexation on profile interests due to the queries
> requirement like range queries to be able to get profiles having interests <
> or > to a certain value.
> So the last option we have to avoid mapping explosion is to index them as
> nested object like this:
> {code:java}
> "interests": [{
> "key": "cars",
> "value": 15
> }, {
> "key": "football",
> "value": 45
> }] {code}
> For that we also need new ConditionType in Unomi, something that look like
> the BooleanConditionType:
> {*}NestedConditionType{*}: would be perfect
> Parameters:
> * {*}path{*}: the path of the nested property
> * {*}condition{*}: the nested query to be applied on the nested property
> So we could build up condition like this:
> {code:java}
> {
> "type": "nestedCondition",
> "parameterValues": {
> "path": "properties.interests",
> "subCondition": {
> "type": "booleanCondition",
> "parameterValues":{
> "operator": "and",
> "subConditions": [{
> "type": "propertyCondition",
> "parameterValues": {
> "propertyName": "properties.interests.key",
> "propertyValueInteger": "cars",
> "comparisonOperator": "equals"
> }
> },{
> "type": "propertyCondition",
> "parameterValues": {
> "propertyName": "properties.interests.value",
> "propertyValueInteger": 15,
> "comparisonOperator": "greaterThan"
> }
> }]
> }
> }
> }
> } {code}
> Also the this would required two new java classes dedicated for that purpose:
> *NestedConditionESQueryBuilder* and {*}NestedConditionEvaluator{*}.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)