-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Elasticsearch] contextual support #251
Conversation
BTW this is a snippet of my APIP mapping: <attribute name="_any">
<attribute name="elasticsearch">
<attribute name="mappings">
<!-- case 1) and 2) from #249 -->
<attribute name="origin">
<attribute name="property">/app_{locale}_article/article#origin.identifier</attribute>
<attribute name="conditions">
<attribute>
<attribute name="property">/app_{locale}_article/article#origin.client</attribute>
<attribute name="value">{client_id}</attribute>
</attribute>
</attribute>
</attribute>
<!-- to be case 3) from #249 (needs to be added at runtime) -->
<attribute name="att_note">
<attribute name="property">/app_{locale}_article/article#extended_attribute_bag_client_user>extended_attribute_bag_client_user.values_{client_id}.note</attribute>
<attribute name="conditions">
<attribute>
<attribute name="property">/app_{locale}_article/article#extended_attribute_bag_client_user>user</attribute>
<attribute name="value">{user_id}</attribute>
</attribute>
</attribute>
</attribute>
</attribute>
</attribute>
</attribute> |
3744382
to
210160d
Compare
Remaining: |
@sstok this works for contextual conditions already, you can see both runtime properties and contextual conditions being assigned. The only thing that comes to mind might be: currently it only allows for simple comparison with AND in contextual conditions, which might be too restrictive, but it also might be fine (so it behaves like IMO we could clean up this PR and merge here, adding runtime mappings could be a separate PR. WDYT? |
This works as-is, ready for review. |
eae3a8d
to
7cec171
Compare
Yay, all green! \o/ @sstok do you think you'd have time to review? |
Looks good to me, are you going to continue in this pull request or in a follow-up? |
Not really much to follow-up except #252, but I think that's fine as a separate PR, since it would require some discussion.
Adding now. 👍 |
6b2bf3f
to
8948816
Compare
This is why reviews are a thing. 🙈 I was sure I added the whole missing part of functionality in another PR before so "it's OK tests are missing here, they're already |
@sstok it should be ready now, tests added from the other branch and it all works here and in my app. |
Can I merge? 👍 |
Yup! \o/ |
Thank you @dkarlovi |
Thank you for the merge. 👍 |
Closes #249. Solves cases 1) and 2) from there. Case 3) is handled by decorating the factory, all use cases work well in my app.