Home / Documentation / Advanced Usage / Payload Attributes

Advanced Usage Tutorials 📖

This tutorial is part of a series to help you learn and perform the advanced functions of zentity. You should complete the basic usage tutorials before completing these advanced usage tutorials.

  1. Matcher Parameters
  2. Date Attributes
  3. Payload Attributes ← You are here.

Payload Attributes

Payload attributes are data elements that don't represent the entity that you resolve, but are worth retrieving when you resolve the entity. They are not used in matching, but they relate to the entity nonetheless. Think of payload attributes as data that you join to the entity, so that you can analyze information that relates to the entity.

For example, let's say you have two indices with purchase order receipts, where each document has details about the customer, the product, and the amount paid. You might want to resolve a customer or a product from the two indices. You might also want to retrieve information about the amount paid so that you can calculate its sum. "Amount paid" is not an attribute of the customer or the product. But you can return the amount paid simply by defining it as an attribute.

There is no distinct concept of a payload attribute in zentity. Attributes will automatically function as payloads if you don't define a "matcher" for the field associated with that attribute in the "indices" object of the entity model. Without a matcher, the attribute will not be used for matching. But if two records are matched with other attributes in the index, then the attributes without matchers will be returned with the result as payload attributes.

 


Continue Reading

Date Attributes Entity Models
© 2018 Dave Moore.
Licensed under the Apache License, Version 2.0.
Elasticsearch is a trademark of Elasticsearch BV.
This website uses Google Analytics.